Skip to content

Logarithm Calculator: log, ln, log₂ and Antilog

log, ln and log₂ of any number in any base, antilogarithms bʸ and the change-of-base formula step by step.

Your details

Calculate
Base b

Must be greater than 0. Scientific notation such as 1e-5 is accepted.

Results update as you type

log_b(x)

3

Exact value
3
Natural log ln(x)
6.907755279
Common log log₁₀(x)
3
Binary log log₂(x)
9.9657842847
Check
10^3 = 1,000

Step-by-step solution
  1. Change of base: log₁₀(1,000) = ln(1,000) / ln(10) = 6.90775527898 / 2.30258509299 = 3
  2. Exact result: 10³ = 1,000, log₁₀(1,000) = 3
  3. Check: 10^3 = 1,000

A logarithm answers one question: to what power must I raise the base to get this number? Since 103=100010^3 = 1000, the base-10 logarithm of 1000 is 3; since 210=10242^{10} = 1024, the base-2 logarithm of 1024 is 10. In symbols, log⁡bx=y\log_b x = y means exactly the same thing as by=xb^y = x, so this calculator is also a way to solve an exponential equation by=xb^y = x for yy.

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: log⁡21024\log_2 1024 is shown as exactly 10, log⁡100.001\log_{10} 0.001 as exactly −3 and log⁡82\log_8 2 as 1/3, rather than a decimal with rounding noise. The antilog mode runs the other way and computes byb^y, even for results far beyond the range of an ordinary calculator, such as 250002^{5000}.

How to use this calculator

  1. Choose Logarithm to find log⁡bx\log_b x, or Antilog to compute byb^y.
  2. Pick the base: 10, e, 2, or Other and type your own (any positive number except 1).
  3. Enter the number xx (it must be greater than 0) or, in antilog mode, the exponent yy.
  4. Read the result. In logarithm mode you also get ln x, log₁₀ x and log₂ x, plus the exact value whenever there is one.
  5. Open the steps to see the change-of-base formula and the check bresult=xb^{\text{result}} = x.

The formula

By definition, for x>0x > 0, b>0b > 0 and b≠1b \neq 1:

log⁡bx=y  ⟺  by=x\log_b x = y \iff b^y = x

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):

log⁡bx=ln⁡xln⁡b=log⁡10xlog⁡10b\log_b x = \frac{\ln x}{\ln b} = \frac{\log_{10} x}{\log_{10} b}

The rules that make logarithms useful follow from the laws of exponents:

log⁡b(xy)=log⁡bx+log⁡bylog⁡bxy=log⁡bx−log⁡bylog⁡bxk=klog⁡bx\log_b(xy) = \log_b x + \log_b y \qquad \log_b\frac{x}{y} = \log_b x - \log_b y \qquad \log_b x^k = k\log_b x

The antilogarithm is the inverse function: antilog⁡b(y)=by\operatorname{antilog}_b(y) = b^y. In particular log⁡b1=0\log_b 1 = 0 and log⁡bb=1\log_b b = 1 for every valid base.

Worked example

Log base 3 of 50. No calculator key gives it directly, so use the change of base:

log⁡350=ln⁡50ln⁡3=3.9120231.098612≈3.560877\log_3 50 = \frac{\ln 50}{\ln 3} = \frac{3.912023}{1.098612} \approx 3.560877

Check: 33.560877≈503^{3.560877} \approx 50. It makes sense, because 33=273^3 = 27 and 34=813^4 = 81, so the answer must lie between 3 and 4.

Log base 2 of 1024 is exactly 10, because 210=10242^{10} = 1024: a 10-bit number has 1024 possible values.

Antilog of 2.5 in base 10: 102.5=102×10≈316.2310^{2.5} = 10^2 \times \sqrt{10} \approx 316.23 (the calculator gives 316.227766017).

pH: a solution with [H+]=3.2×10−4[\text{H}^+] = 3.2 \times 10^{-4} mol/L has pH=−log⁡10(3.2×10−4)≈3.49\text{pH} = -\log_{10}(3.2 \times 10^{-4}) \approx 3.49.

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: log⁡2N\log_2 N rounded up is the number of bits needed to store NN different values, and the number of steps a binary search needs in a sorted list of NN items. For example log⁡21 000 000≈19.93\log_2 1\,000\,000 \approx 19.93, 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 log⁡bx=y\log_b x = y then x=antilog⁡by=byx = \operatorname{antilog}_b y = b^y. Old log tables had a separate antilog table; today it is simply the 10x10^x or exe^x 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 [H+]=10−3[\text{H}^+] = 10^{-3} mol/L, a sound level of 60 dB to 10610^{6} times the reference intensity, and a magnitude difference of 2 on the Richter scale to 102=10010^{2} = 100 times the wave amplitude. Choose Antilog above, pick the base and enter yy.

Common, natural and other bases

Name Notation Base Typical use
Common (decimal) logarithm log⁡x\log x or log⁡10x\log_{10} x 10 pH, decibels, orders of magnitude, slide rules
Natural (Napierian) logarithm ln⁡x\ln x e≈2.71828e \approx 2.71828 calculus, growth and decay, interest compounded continuously
Binary logarithm log⁡2x\log_2 x or lb⁡x\operatorname{lb} x 2 bits, algorithms, octaves

Beware of notation: in many maths and programming texts log⁡x\log x means ln⁡x\ln x, 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

Last updated:

More Math calculators

People also use