In short
A logarithm answers the question “what power do I raise the base to, to get this number?” log₁₀ 1000 = 3 because 10³ = 1000. The common logarithm uses base 10, the natural logarithm (ln) uses e ≈ 2.71828, and computer science often uses base 2. Any base can be computed from natural logs with the change-of-base formula.
How it works
y = log_b x ⇔ bʸ = x (x > 0, b > 0, b ≠ 1)
Evaluating a logarithm means finding an exponent. OpenStax Intermediate Algebra works examples like log₅ 25 = 2 because 5² = 25, log₉ 3 = 1/2 because 9^(1/2) = 3, and log₂ (1/16) = −4 because 2⁻⁴ = 1/16.
log_b x = ln x ÷ ln b = log₁₀ x ÷ log₁₀ b
Calculators only have keys for log (base 10) and ln (base e), so other bases are computed by change of base, which is what this calculator does too.
log_b (MN) = log_b M + log_b N log_b (M/N) = log_b M − log_b N log_b (Mᵖ) = p × log_b M
Worked examples
log 1000
1000 = 10³, so log₁₀ 1000 = 3. Base-10 logarithms count powers of ten, which is why they are used for scales like decibels and the Richter scale.
log base 5 of 25
Choose Other and enter 5. Change of base gives ln 25 ÷ ln 5 = 3.2189 ÷ 1.6094 = 2, matching OpenStax’s Example 10.21. A raw computer division gives 2.0000000000000004; the calculator trims that floating-point noise.
How many years to double at 7% a year?
Money growing 7% a year is multiplied by 1.07ᵗ. It doubles when 1.07ᵗ = 2, so t = log base 1.07 of 2 = 10.2448 years. The rule of 72 estimates 72 ÷ 7 ≈ 10.3.
Using this calculator well
- “log” can mean different bases. In school maths and engineering log means base 10; in many programming languages and higher maths it means the natural log. Check the convention before using a result.
- Antilog is the reverse. If log x = 2.5, then x = 10^2.5 ≈ 316.2. Use the exponent calculator for antilogs.
- Logs turn multiplication into addition. That is why they appear in decibels, pH and earthquake magnitudes: each step of 1 multiplies the quantity by the base.
- No logarithm of zero or negatives. No power of a positive base is zero or negative, so log x is undefined for x ≤ 0.
Frequently asked questions
What is the difference between log and ln?
log usually means the common logarithm, base 10, and ln is the natural logarithm, base e ≈ 2.71828. They differ by a constant factor: ln x = log x × ln 10 ≈ 2.302585 × log x. So log 100 = 2 while ln 100 ≈ 4.60517.
How do I calculate log base 2?
Divide the natural log (or common log) of the number by that of 2. log₂ 1024 = ln 1024 ÷ ln 2 = 10, because 2¹⁰ = 1024. Choose base 2 in the calculator to get it directly; it is used for bits, binary trees and halving problems.
Why is the log of 1 equal to 0 in every base?
Any non-zero base raised to the power 0 equals 1, so the exponent that turns the base into 1 is always 0. Similarly log_b b = 1, because b¹ = b, whatever the base is.
Can a logarithm be negative?
Yes. With a base above 1, numbers between 0 and 1 have negative logarithms: log 0.01 = −2 because 10⁻² = 0.01. What cannot happen is taking the logarithm of zero or of a negative number.
Sources and methodology
- Intermediate Algebra 2e, 10.3 Evaluate and Graph Logarithmic Functions, OpenStax, Rice University, y = log_a x ⇔ x = aʸ; common log base 10, natural log base e; Example 10.21: log₅ 25 = 2, log₉ 3 = 1/2, log₂ (1/16) = −4; Example 10.26: log 10¹⁰ = 10 (accessed November 24, 2026)
- Intermediate Algebra 2e, 10.4 Use the Properties of Logarithms, OpenStax, Rice University, change-of-base formula: log_a M = log_b M ÷ log_b a (accessed November 24, 2026)
Rounding: Computed in double precision and shown to 12 significant digits.
Review status: formulas verified against the cited sources by automated tests; editorial review pending. Version 1.0.0, content updated November 24, 2026.
Changelog
- 1.0.0 · November 24, 2026: First published.
How we build and test calculators
Embed this calculator on your site
Paste this code into your page. The calculator runs in a frame, with no tracking and no cookies, and links back here for the formula and sources.
<iframe src="https://northcalculator.com/embed/en/logarithm" title="Logarithm Calculator" width="100%" height="760" style="border:0" loading="lazy"></iframe>