A logarithm answers one question: to what power must I raise the base to get this number? Since , the base-10 logarithm of 1000 is 3; since , the base-2 logarithm of 1024 is 10. In symbols, means exactly the same thing as , so this calculator is also a way to solve an exponential equation for .
Choose base 10 (the common logarithm, written log), e (the natural logarithm, ln), 2 (the binary logarithm, log₂, used everywhere in computing) or any other positive base. Alongside the result you always see ln x, log₁₀ x and log₂ x, the change-of-base calculation and a check that raises the base back to the answer.
When the answer is a whole number or a simple fraction, the calculator says so: is shown as exactly 10, as exactly −3 and as 1/3, rather than a decimal with rounding noise. The antilog mode runs the other way and computes , even for results far beyond the range of an ordinary calculator, such as .
How to use this calculator
- Choose Logarithm to find , or Antilog to compute .
- Pick the base: 10, e, 2, or Other and type your own (any positive number except 1).
- Enter the number (it must be greater than 0) or, in antilog mode, the exponent .
- Read the result. In logarithm mode you also get ln x, log₁₀ x and log₂ x, plus the exact value whenever there is one.
- Open the steps to see the change-of-base formula and the check .
The formula
By definition, for , and :
Calculators and computers only evaluate a few logarithms directly, so any other base goes through the change-of-base formula (NIST DLMF 4.2.8):
The rules that make logarithms useful follow from the laws of exponents:
The antilogarithm is the inverse function: . In particular and for every valid base.
Worked example
Log base 3 of 50. No calculator key gives it directly, so use the change of base:
Check: . It makes sense, because and , so the answer must lie between 3 and 4.
Log base 2 of 1024 is exactly 10, because : a 10-bit number has 1024 possible values.
Antilog of 2.5 in base 10: (the calculator gives 316.227766017).
pH: a solution with mol/L has .
Logarithm in base 2 (binary logarithm)
The base-2 logarithm counts how many times you can halve a number before reaching 1, or how many doublings it takes to get there. It is the natural unit of computing: rounded up is the number of bits needed to store different values, and the number of steps a binary search needs in a sorted list of items. For example , so 20 bits (or 20 comparisons) are enough for a million items. Base 2 also measures information in bits (Shannon entropy) and musical octaves, where each octave doubles the frequency. To convert a number to binary, see the binary calculator.
Antilogarithm: going back from the logarithm
The antilogarithm (antilog) undoes a logarithm: if then . Old log tables had a separate antilog table; today it is simply the or key. You need it whenever a quantity is reported on a logarithmic scale and you want the original value back: a pH of 3 corresponds to mol/L, a sound level of 60 dB to times the reference intensity, and a magnitude difference of 2 on the Richter scale to times the wave amplitude. Choose Antilog above, pick the base and enter .
Common, natural and other bases
| Name | Notation | Base | Typical use |
|---|---|---|---|
| Common (decimal) logarithm | or | 10 | pH, decibels, orders of magnitude, slide rules |
| Natural (Napierian) logarithm | calculus, growth and decay, interest compounded continuously | ||
| Binary logarithm | or | 2 | bits, algorithms, octaves |
Beware of notation: in many maths and programming texts means , while on a pocket calculator the log key is base 10. The natural logarithm is the one that appears in exponential growth and half-life formulas.
Frequently asked questions
How do I calculate a logarithm with any base?
Divide the natural logarithms: log_b(x) = ln(x) / ln(b). Base-10 logarithms work just as well. For example log₅(125) = ln 125 / ln 5 = 4.8283 / 1.6094 = 3, because 5³ = 125.
What is log base 2 of a number?
It is the power of 2 that gives the number: log₂(8) = 3, log₂(1024) = 10, log₂(0.5) = −1. For values that are not powers of 2, compute ln(x) / ln(2), or select base 2 above.
What is an antilogarithm?
The antilog is the inverse of the logarithm: antilog_b(y) = bʸ. The base-10 antilog of 2 is 100 and the natural antilog of 1 is e ≈ 2.71828. Use the Antilog mode to compute it.
Why can’t I take the log of zero or a negative number?
Because a positive base raised to any real power is always positive. No exponent turns 10 into 0 or into −5, so log(0) and log(−5) are undefined among real numbers. As x approaches 0 from above, the logarithm falls towards minus infinity.
What is the difference between log and ln?
On calculators, log is base 10 and ln is base e ≈ 2.71828. They differ by a constant factor: ln(x) = log₁₀(x) × ln(10) ≈ 2.302585 × log₁₀(x).
How do I solve bʸ = x for y?
Take the logarithm of both sides: y = log_b(x) = ln(x) / ln(b). For 2ʸ = 50, y = ln 50 / ln 2 ≈ 5.643856. Enter base 2 and x = 50 to get it directly.
Sources
- NIST Digital Library of Mathematical Functions, §4.2 Logarithm, Exponential, Powers — Definitions (eq. 4.2.8, change of base)
- OpenStax, College Algebra 2e — §6.3 Logarithmic Functions
- OpenStax, College Algebra 2e — §6.5 Logarithmic Properties (change-of-base formula)
Last updated: