Logarithm Calculator — Calculate log_b(x)
Calculate the logarithm of any number with any base. Supports natural log (ln), log base 2, log base 10, and custom bases. See also Exponent Calculator and Scientific Notation Calculator.
How to Calculate Logarithms
A logarithm answers the question: "To what power must the base be raised to produce a given number?" For example, log₁₀(100) = 2 because 10² = 100. Enter the number and base, then click Calculate. Use the quick buttons to switch between common bases: natural log (base e ≈ 2.718), binary log (base 2), and common log (base 10). You can also enter any custom base.
Logarithm Formula
log_b(x) = y means b^y = x
Change of base formula:
log_b(x) = ln(x) / ln(b) = log(x) / log(b)
Key properties:
log_b(1) = 0
log_b(b) = 1
log_b(x × y) = log_b(x) + log_b(y)
log_b(x / y) = log_b(x) − log_b(y)
log_b(x^n) = n × log_b(x)
Example
log₁₀(100) = ?
We need: 10^? = 100
10^2 = 100
Therefore log₁₀(100) = 2
Frequently Asked Questions
What is the difference between log and ln?
"log" typically refers to the common logarithm (base 10), while "ln" is the natural logarithm (base e ≈ 2.71828). In some contexts (especially pure math), "log" means natural log. This calculator lets you specify any base explicitly.
Why can't I take the log of a negative number?
In real numbers, logarithms are only defined for positive values. There is no real number y such that b^y equals a negative number (when b > 0). Logarithms of negative numbers exist in complex analysis but are beyond this calculator's scope.
Why can't the base be 1?
Because 1 raised to any power is always 1. So log₁(x) is undefined for x ≠ 1, and indeterminate for x = 1 (any exponent works). The base must be positive and not equal to 1.
What is log base 2 used for?
Log base 2 (binary logarithm) is fundamental in computer science. It measures the number of bits needed to represent a number, appears in algorithm complexity analysis (e.g., binary search is O(log₂ n)), and is used in information theory.
How do I convert between log bases?
Use the change of base formula: log_b(x) = log_c(x) / log_c(b). For example, log₂(8) = ln(8) / ln(2) = 2.079 / 0.693 = 3.