Logarithm Calculator

Find the logarithm of any positive number in any base, with natural, common and binary logs side by side and the change-of-base steps.

Any positive number except 1. Type e for the natural log, 10 for the common log.
Must be greater than 0. Fractions and 1e6-style numbers work.
Natural log ln(x)
6.907755278982
Common log log₁₀(x)
3
Binary log log₂(x)
9.965784284662
Digits in x
4= ⌊log₁₀ x⌋ + 1
log₂(1,000)9.965784284662

Show the work

  1. log2(1,000) asks: what power of 2 gives 1,000? In symbols, find y with 2y = 1,000.
  2. Change of base: log2(1,000) = ln(1,000) ÷ ln(2) = 6.907755279 ÷ 0.6931471806 = 9.965784284662.
  3. The same ratio with common logs: log(1,000) ÷ log(2) = 3 ÷ 0.3010299957 = 9.965784284662.
  4. Check: 29.96578428 ≈ 1,000.

A logarithm answers the question “what exponent do I need?” — log₂(1,000) asks which power of 2 equals 1,000, and the answer is about 9.97. Logarithms turn multiplication into addition and huge ranges into manageable ones, which is why they appear in everything from the decibel scale to computer science. This calculator finds the log of any positive number in any base and gives the exact value when one exists.

How to use the logarithm calculator

  1. Enter the base b: any positive number except 1. Type e for the natural logarithm or 10 for the common logarithm.
  2. Enter the number x, which must be greater than 0. Fractions such as 1/8 and scientific notation such as 1e-6 are accepted.
  3. Read log_b(x) on the tape, along with ln(x), log₁₀(x) and log₂(x). The steps show the change-of-base calculation and a check.

Logarithm formulas

The definition links logs and exponents:

logb(x) = y  ⟺  by = x

The change-of-base formula lets you compute any base from natural or common logs:

logb(x) = ln(x) ÷ ln(b) = log10(x) ÷ log10(b)
Law Formula Example
Product log_b(MN) = log_b M + log_b N log 20 = log 2 + log 10 ≈ 1.301
Quotient log_b(M/N) = log_b M − log_b N log₂(32/4) = 5 − 2 = 3
Power log_b(Mᵏ) = k · log_b M log₃(9⁴) = 4 × 2 = 8
Identity log_b(b) = 1 and log_b(1) = 0 ln e = 1

Worked example

Find log₂(1,000).

Change of base: log₂(1,000) = ln(1,000) ÷ ln(2) = 6.907755279 ÷ 0.6931471806 = 9.965784285.

Common logs give the same ratio: log(1,000) ÷ log(2) = 3 ÷ 0.3010299957 = 9.965784285.

Check: 2⁹ = 512 and 2¹⁰ = 1,024, and 1,000 lies between them, so the answer should be just under 10. ✓

Some logs are exact fractions. log₄(8) = 3/2 because the square root of 4 is 2 and 2³ = 8, so 4^(3/2) = 8. Likewise log₈(4) = 2/3 and log_(1/2)(8) = −3. The calculator detects these and shows the fraction.

Common bases and where they are used

  • Base 10 (common log). Scientific scales built on powers of ten: pH in chemistry is −log₁₀ of the hydrogen-ion concentration, the decibel is 10·log₁₀ of a power ratio, and the Richter magnitude rises by 1 for every tenfold increase in amplitude. The integer part of log₁₀ x also tells you how many digits x has.
  • Base e (natural log). Continuous growth and decay. A population growing continuously at rate r doubles after ln(2)/r time units, and ln appears throughout calculus because the derivative of ln x is 1/x.
  • Base 2 (binary log). Computing and information. A binary search through a million sorted items takes about log₂(1,000,000) ≈ 20 comparisons, and n bits can represent 2ⁿ values.

Pitfalls

  1. Log of a sum. log(a + b) is not log a + log b. The product law only applies to multiplication.
  2. Bases between 0 and 1. With base 1/2, larger numbers have smaller (more negative) logs, so the usual “bigger in, bigger out” intuition reverses.
  3. Mixing up ln and log. On most calculators, LOG means base 10 and LN means base e. Using the wrong one changes the answer by a factor of about 2.303.

To solve log_b(x) = y for the base or for x instead, use the logarithm equation calculator. To find an unknown exponent directly, see the solve for exponent calculator.

Frequently asked questions

What is a logarithm?

A logarithm is an exponent. log_b(x) is the power you raise b to in order to get x, so log₂(8) = 3 because 2³ = 8. Logarithms undo exponentials the way division undoes multiplication.

How do I calculate a log with an unusual base?

Use the change-of-base formula: log_b(x) = ln(x) ÷ ln(b), or equivalently log(x) ÷ log(b) with common logs. Most calculators only have ln and log buttons, and this formula connects them to every other base.

Why can't I take the log of 0 or a negative number?

A positive base raised to any real power is always positive, so no exponent produces 0 or a negative number. As x approaches 0 from above, log_b(x) heads toward negative infinity for any base greater than 1.

What is the difference between log, ln and lg?

ln is the natural log, base e ≈ 2.71828. In most US textbooks log with no base means base 10, while in computer science it often means base 2 (sometimes written lg). This calculator shows all three at once.

What is log of 1?

Zero, in every base, because any non-zero number raised to the power 0 equals 1.

Last reviewed October 2026 by the CalcFluent editorial team. How we check our calculators.