Skip to content
Omnikalc

Logarithm calculator: log, ln, log₂ and antilog

Calculate the logarithm of a number in any base, the natural and common logs, and the inverse: the base raised to a power and e to the x.

Updated on
Your inputs

Value out of range

Value out of range

Results

log_b(x)

3.000000

Antilog: b to the power x

256.000000

Natural log ln(x)
2.079442
Common log log₁₀(x)
0.903090
Binary log log₂(x)
3.000000
e to the power x
2,980.957987
10 to the power x
100,000,000.0000

Other values of x

log_b(x)Natural log ln(x)Common log log₁₀(x)
x = 0.50 current-1.000000-0.693147-0.301030
x = 1 current0.0000000.0000000.000000
x = 2 current1.0000000.6931470.301030
x = 4 current2.0000001.3862940.602060
x = 8 current3.0000002.0794420.903090
x = 16 current4.0000002.7725891.204120
x = 32 current5.0000003.4657361.505150

What a logarithm is

A logarithm answers the question “to what power must I raise the base to get this number?”. Since 2³ = 8, the base-2 logarithm of 8 is 3: log₂(8) = 3. Logarithms turn multiplication into addition and powers into multiplication, which is why they appear in sound levels, earthquake magnitudes, pH, compound interest and algorithm analysis.

The common logarithms

  • Natural log ln(x): base e ≈ 2.71828, used in growth, decay and calculus.
  • Common log log₁₀(x): base 10, used for orders of magnitude, decibels and pH.
  • Binary log log₂(x): base 2, used in computing and information theory.

Any base can be computed with the change of base formula: log_b(x) = ln(x) ÷ ln(b).

Worked example: x = 8, base 2

  1. log₂(8) = 3, because 2³ = 8.
  2. ln(8) = 2.079442.
  3. log₁₀(8) = 0.903090.
  4. Check with the change of base: 2.079442 ÷ ln(2) = 2.079442 ÷ 0.693147 = 3.
  5. The inverse operations: 2⁸ = 256, e⁸ ≈ 2,980.96, 10⁸ = 100,000,000.

Logarithm rules

  • log(a × b) = log(a) + log(b)
  • log(a ÷ b) = log(a) − log(b)
  • log(aⁿ) = n × log(a)
  • log_b(1) = 0 and log_b(b) = 1
  • The logarithm is defined only for positive numbers, and the base must be positive and different from 1.

Logs of powers of two

x log₂ x ln x log₁₀ x
0.5 −1 −0.693 −0.301
1 0 0 0
2 1 0.693 0.301
4 2 1.386 0.602
16 4 2.773 1.204
32 5 3.466 1.505

Practical uses

  • Solving for time: money growing at 5% a year doubles after ln(2) ÷ ln(1.05) = 14.2 years.
  • Decibels: a sound 100 times more intense is 10 × log₁₀(100) = 20 dB louder.
  • pH: pH = −log₁₀ of the hydrogen ion concentration; each unit is a factor of 10.
  • Computing: a binary search through 1,000,000 sorted items needs about log₂(1,000,000) ≈ 20 steps.
  • Antilog: the antilogarithm is just the power: if log₁₀(x) = 2.5, then x = 10^2.5 ≈ 316.2.

Frequently asked questions

What is log base 2 of 8?

3, because 2³ = 8.

How do I calculate a logarithm in any base?

Use the change of base formula: log_b(x) = ln(x) ÷ ln(b), or log₁₀(x) ÷ log₁₀(b).

What is the difference between log and ln?

ln is the natural logarithm, in base e ≈ 2.718. log usually means base 10, although in some programming languages log() is the natural logarithm.

Can you take the log of a negative number?

Not with real numbers. The logarithm is defined only for numbers greater than 0, and log(0) is undefined.

Was this calculator helpful?

Thanks for your feedback!

Results are estimates provided for information purposes. They do not replace professional advice.