Skip to content

How do you calculate a logarithm in any base?

Find log_b(x) or the power b^y in any base, with ln, log₁₀ and log₂.

Find

log₂(8)

3

log₂(8) = 3 because 2³ = 8.

Key values as a table
xlog₂(x)
10
21
42
83
ln x
2.07944
log₁₀ x
0.90309
log₂ x
3
Formula

Change of base: log₂(8) = ln 8 / ln 2 = 2.07944 / 0.693147 = 3

Find log_b(x) or the power b^y in any base, with ln, log₁₀ and log₂.

How to use

  1. Choose what to find: the logarithm (the exponent) or the power (the number).
  2. Pick the base: 10, e, 2 or any other, and type the number or the exponent.
  3. Read the answer with the change of base and the logarithms in bases e, 10 and 2. Drag the point along the curve to try other values.

Logarithms of common numbers

Numberlog₁₀lnlog₂
20.3010.6931
1012.3033.322
10024.6056.644
1,00036.9089.966
1,000,000613.81619.932

How it works

A logarithm answers the question: to what power must I raise the base to get this number? Since 10³ = 1000, log₁₀(1000) = 3, and since 2⁵ = 32, log₂(32) = 5. So y = log_b(x) and b^y = x say the same thing, and this tool works in both directions.

Calculators usually only know ln (base e ≈ 2.71828) and log (base 10). Any other base comes from the change-of-base rule log_b(x) = ln(x) / ln(b). For log₃(81): ln 81 / ln 3 = 4.39445 / 1.09861 = 4, because 3⁴ = 81. The curve always passes through (1, 0) and (b, 1), climbs ever more slowly for bases above 1, and never reaches x = 0.

Logarithms exist only for positive numbers and bases other than 1. Results are rounded to six significant digits. Sources: OpenStax College Algebra 2e, sections 6.3 and 6.5.

Frequently asked questions

What is the difference between log and ln?

ln means base e, while log often means base 10. Some subjects use log for other bases, so check the convention and select the intended base.

How do I solve 2^x = 50?

Choose Logarithm, base 2 and number 50. The result is x ≈ 5.64386.

Why can a logarithm be negative?

For a base greater than 1, numbers between 0 and 1 have negative logarithms. A negative exponent gives the reciprocal of a positive power.

Can I use a base between 0 and 1?

Yes. Choose a custom base; the logarithm then decreases as the input increases.

Is log(x + y) equal to log(x) + log(y)?

No. The sum of logarithms equals the logarithm of a product, log(xy), for positive x and y in the same base.

Send feedback