What this calculator does
A logarithm answers the question: to what power must this base be raised to get that number? It is the inverse of exponentiation, and it turns multiplication into addition: the property that made logarithm tables and slide rules indispensable for three centuries before electronic calculators.
Three bases dominate. Base 10 suits anything measured on decimal scales, base 2 counts doublings and appears throughout computing, and base e, the natural logarithm, arises wherever continuous growth or decay occurs, which is most of physics and much of finance.
The formula
The change of base formula lets any logarithm be computed from any other: log_b(x) equals ln x divided by ln b. That is why a calculator only needs one logarithm built in to produce all of them.
| Term | Meaning |
|---|---|
| log_b(x) | The power to which b must be raised to give x. |
| ln | Natural logarithm, base e ≈ 2.71828. |
| log₁₀ | Common logarithm, base 10. |
| log₂ | Binary logarithm, base 2. |
| Antilog | The inverse: bˣ. |
The inputs explained
| Field | What to enter |
|---|---|
| Value x | The value whose logarithm you want. It must be positive: logarithms of zero and negative numbers are undefined in real arithmetic. |
| Base b | The base. Common choices are 10, e (about 2.71828) and 2. |
When to use it
Working with decibels, pH or magnitude
These scales are all logarithmic, which is why a small numeric step represents a large physical change. An earthquake one point higher on a magnitude scale releases roughly 32 times more energy.
Solving for time in growth problems
When an exponential equation has the unknown in the exponent, taking logarithms brings it down where it can be solved. This is how doubling time is derived.
Measuring algorithmic complexity
Binary logarithms count how many times a set can be halved, which is why binary search runs in log₂(n) steps.
Compressing a wide range of values
Plotting on a logarithmic axis makes data spanning several orders of magnitude readable, and turns exponential growth into a straight line.
Worked examples
Every figure in the tables below is produced by this page’s own calculator at build time, so the numbers and the tool always agree. Select any row to load that scenario.
Logarithms of powers of ten
The common logarithm counts the zeros: its defining convenience.
| Value | log_b(x) | Natural log ln(x) | Binary log log₂(x) |
|---|---|---|---|
| 0.01 | -2.000 | -4.605 | -6.644 |
| 1 | 0 | 0 | 0 |
| 10 | 1.000 | 2.303 | 3.322 |
| 100 | 2.000 | 4.605 | 6.644 |
| 1000 | 3.000 | 6.908 | 9.966 |
| 1000000 | 6.000 | 13.816 | 19.932 |
The same value in different bases
One thousand, expressed as a logarithm in a range of bases.
Questions
What is the difference between log and ln?
By common convention log means base 10 and ln means base e, the natural logarithm. In pure mathematics and some programming languages, log alone often means the natural logarithm, so it is worth checking which is meant.
Why is e the natural base?
Because the exponential function with base e is its own derivative, which makes it the natural choice wherever continuous change is described. It appears unavoidably in growth, decay, compounding and probability.
Can I take the log of a negative number?
Not within real numbers. No real power of a positive base produces a negative result. Complex logarithms exist but behave quite differently, having infinitely many values.
What is the change of base formula?
log_b(x) = ln x ÷ ln b, or equivalently log₁₀x ÷ log₁₀b. It converts between any two bases and is how calculators produce arbitrary-base logarithms from a single built-in function.
Why do logarithms turn multiplication into addition?
Because log(ab) = log a + log b. Multiplying numbers means adding their exponents, and a logarithm is an exponent. That identity is precisely what slide rules exploited.
For the inverse operation, see the exponent calculator. For doubling times, try the rule of 72.