A little help goes a long way. Find a tool/

Math FIELD NOTES · 4 MIN READ

Logarithms Explained: What log, ln and log₂ Actually Compute

A logarithm asks "which power?" — how change-of-base computes any base, why log, ln and log₂ differ only by base, and why the input must be positive.

How many times must you multiply 2 by itself to reach 1,024? Ten. That single sentence is a logarithm: log₂(1024) = 10. A logarithm reverses the question an exponent answers — instead of asking what a power produces, it asks which power was used.

The question a logarithm asks

log_b(x) is the number you must raise b to in order to get x:

log₁₀(1000)  = 3     because 10³ = 1000
log₂(1024)   = 10    because 2¹⁰ = 1024
log₂(8)      = 3     because 2³  = 8

Powers grow so fast that the answer stays small even for enormous x — every value from 1 up to a trillion logs to something between 0 and 12 in base 10. That compression is why logs show up wherever quantities span huge ranges, from earthquake magnitudes to star brightness. The exponents-and-logarithms deep dive covers the log laws and real-world scales in detail; this article focuses on how the number itself is computed.

Computing any base: the change-of-base formula

Processors only ship one logarithm natively (the natural log, base e). Every other base comes from dividing it out:

log_b(x) = ln(x) / ln(b)

log₂(1024) = ln(1024) / ln(2) = 6.931... / 0.693... = 10

This is exactly what a logarithm calculator does internally, which is why it accepts any positive base rather than just the famous three. Both divisions produce the same answer regardless of which "native" log you use — try it with log₁₀ instead of ln and the result is identical.

The three named logarithms

Three bases appear so often they have their own names. log₁₀, the common logarithm, is the default for powers of ten: log₁₀(500) = 2.6989700043, meaning 500 sits about 70% of the way up from 100 to 1000. ln, the natural logarithm, uses base e ≈ 2.71828 and is the one calculus prefers because e describes continuous growth; ln(20) = 2.9957322736. log₂, the binary logarithm, counts doublings and therefore bits: it answers questions like "how many halvings until this is gone?" The name is cosmetic — all three are the same operation with different b, and the special names just signal what the number will be used for.

The domain rules: what logs refuse to compute

A logarithm only exists for positive values and positive bases other than 1. These are not arbitrary restrictions, and a good calculator enforces all three:

log(0)      → no answer: no power of a positive base hits zero
log(−5)     → no answer: powers stay positive
log base 1  → no answer: 1 raised to anything is always 1

Negative values are not reachable because multiplying positive numbers never crosses below zero; zero is unreachable for the same reason. (Complex numbers do open a door for negative inputs, but that is a different number system with different rules.) Base 1 fails from the other direction — it collapses every input to the same output, so the "inverse question" has no unique answer. A base between 0 and 1 is legal, just strange: logs come out negative because fractional bases shrink as you raise them.

Reading a non-round answer

Most logs are not tidy integers, and the decimal part carries real meaning. log₁₀(500) ≈ 2.699 says 500 lies between 10² = 100 and 10³ = 1000, about seven-tenths of the way — multiply 10 by itself 2.699 times and you land on 500. The fractional part is a position on the logarithmic ruler, which is why log₁₀(5) ≈ 0.699 shares its decimal with log₁₀(500) ≈ 2.699: same digits, shifted by the exponent. Reading logs this way turns them into a quick mental tool for sizing numbers up.

Try it yourself

The Logarithm Calculator computes log, ln, and log₂ — or any custom base — using the change-of-base division, rejecting impossible inputs with an explanation. The Exponent Calculator runs the operation in reverse, computing b^x so you can verify a log by raising the base back to the result. And the Scientific Notation Converter shows the same compression at work on powers of ten.

Frequently asked questions

What does a logarithm tell you?
The power you must raise the base to in order to produce the value. log₂(1024) = 10 because 2¹⁰ = 1024, and log₁₀(1000) = 3 because 10³ = 1000. Exponents answer "what do I get?"; logarithms answer "how many multiplications did it take?"
How is a logarithm computed for any base?
With the change-of-base formula: log_b(x) = ln(x) / ln(b). For log₂(1024) that is 6.9315 / 0.6931 = 10. This is exactly what the calculator does internally, which is why it accepts any positive base rather than only the built-in ones.
What is the difference between log, ln and log₂?
Only the base. log₁₀ is the common logarithm (powers of ten, pH, decibels), ln uses base e ≈ 2.71828 (calculus and continuous growth), and log₂ is the binary logarithm (doublings and bits). The names signal the intended use; the operation is identical.
Why can you not take the log of zero or a negative number?
No real power of a positive base can produce zero or a negative result — multiplying positive numbers never crosses below zero. The calculator rejects non-positive values (and a base of 1, which turns every power into 1) instead of returning a misleading answer.
How is a logarithm calculator different from an exponent calculator?
They are inverse operations. An exponent calculator computes b^x — given the base and power, find the result. A logarithm calculator runs the question backwards — given the base and result, find the power. You can verify any log by exponentiating: log₂(1024) = 10 checks out because 2¹⁰ really is 1024.