Logarithm Calculator

Calculate the logarithm log_b(x) for any base, plus the natural log (ln), log₁₀ and log₂.

Your result will appear here

Fill in the fields and press Calculate.

A logarithm answers the question "what power do I raise the base to, to get this number?" log₁₀(1000) is 3 because 10³ = 1000. It's the inverse of exponentiation and the backbone of scales like pH, decibels and the Richter scale.

Enter a number and a base to get its logarithm, along with the natural log, log₁₀ and log₂.

How is it calculated?

What a logarithm is

log_b(x) is the exponent that turns b into x: if b^y = x, then log_b(x) = y. So log₂(8) = 3 because 2³ = 8.

Change of base

Calculators compute any base from natural logs using the change-of-base rule:

log_b(x) = ln(x) ÷ ln(b)

That's how this tool handles an arbitrary base — and why it can show ln, log₁₀ and log₂ side by side for the same number.

The common bases

NotationBaseUsed for
lne ≈ 2.718calculus, growth/decay
log or log₁₀10pH, decibels, scientific notation
log₂2computer science, information theory

The rules that make logs useful

Logarithms turn multiplication into addition: log(x·y) = log(x) + log(y), log(x/y) = log(x) − log(y), and log(xⁿ) = n·log(x). These identities are why log scales compress huge ranges and why they were once used for hand multiplication.

Where it helps

Solving exponential equations, pH and decibel problems, half-life and compound-growth math, and algorithm analysis. The input must be positive — the log of zero or a negative number is undefined.

Worked example

Take log₁₀(1000): you need the power of 10 that gives 1000, which is 3. For a non-round base, say log₂(50), the change-of-base rule gives ln(50) ÷ ln(2) ≈ 3.912 ÷ 0.693 ≈ 5.644 — meaning 2^5.644 ≈ 50. The tool also reports ln(50) ≈ 3.912 and log₁₀(50) ≈ 1.699.

FAQ

What is a logarithm?+

The logarithm log_b(x) is the exponent to which the base b must be raised to produce x. Since 10³ = 1000, log₁₀(1000) = 3.

What is the difference between log and ln?+

"log" usually means base 10, while "ln" is the natural log with base e ≈ 2.718. This tool shows both for any number you enter.

How does change of base work?+

log_b(x) = ln(x) ÷ ln(b). This lets a calculator find a logarithm in any base using natural logs, which is exactly how this tool computes it.

Why can’t I take the log of a negative number?+

No real power of a positive base gives a negative result, so the logarithm of zero or a negative number is undefined in the real numbers. The input must be positive.

What is log₂ used for?+

Log base 2 counts how many times a number can be halved, so it appears in computer science, information theory (bits) and the analysis of algorithms.