Skip to main content

Logarithm Explained: ln, log₁₀, log₂, and the Change-of-Base Formula

A plain-English guide to logarithms — the inverse of exponentiation, common and natural log, arbitrary bases, change of base, and where logs show up in pH, decibels, and code.

Published By Li Lei
#math #logarithm #calculator #algorithms

Logarithm Explained: ln, log₁₀, log₂, and the Change-of-Base Formula

If exponentiation is the question "what is 2 raised to the power 3?", a logarithm is the question turned inside out: "2 raised to what power gives 8?" The answer to both is tied together by the number 3, and once you see logarithms as that mirror image of powers, most of the confusion around ln, log, and "the base" falls away. This guide walks through what a logarithm actually asks, the three bases you meet in practice, the one formula that connects all of them, and the places logs quietly run the world.

A logarithm is the inverse of an exponent

Every logarithm is built around a base. Written log_b(x), it answers exactly one question: b to what power is x? That single sentence is the whole idea. The base b is the number you keep multiplying, x is the target you want to reach, and the logarithm is the exponent that gets you there.

Compare the two directions side by side:

  • Exponentiation: 2 raised to the power 3 = 8 (start with the power, get the result)
  • Logarithm: log₂(8) = 3 (start with the result, get the power)

They undo each other. If you take log₂ of , you get 3 back. If you raise 2 to the power log₂(8), you get 8 back. This is why a logarithm needs a positive argument and a base that is greater than zero and not equal to one. A base of 1 can never climb away from 1 no matter what power you use, so it could never reach 2 or 10, and the answer would be undefined. The Logarithm Calculator refuses those impossible inputs and tells you which one broke the rule instead of handing back a baffling NaN.

Worked example: reading the answer straight off

Two clean cases make the inverse relationship concrete.

log₂(8) = 3. Ask "2 to what power is 8?" Count the multiplications: 2 × 2 × 2 = 8, that is three twos, so the answer is 3. Push it further and log₂(1024) = 10, because 2 multiplied by itself ten times lands on 1024.

log₁₀(1000) = 3. Ask "10 to what power is 1000?" Here 10 × 10 × 10 = 1000, three tens, so the answer is again 3. The base-10 version is friendly because each whole-number answer just counts zeros: log₁₀(100) = 2, log₁₀(1000) = 3, log₁₀(1000000) = 6.

Notice that the same input, 1000, gives a different logarithm depending on the base. That is the entire reason the base has to be stated. A bare "log" with no base is an invitation to a mistake.

Three bases you actually meet

In the wild, three bases cover almost everything.

Common log, log₁₀. Base 10, written log on most calculators and in many engineering tables. It matches the way we write numbers, so it dominates anything measured in orders of magnitude — sound levels, acidity, earthquake energy.

Natural log, ln. Base e ≈ 2.71828, a constant that shows up wherever something grows or decays continuously. ln is the default in calculus and physics because the slope of ln(x) is simply 1 ÷ x, the cleanest derivative any logarithm can have. Watch the trap: ln and log₁₀ are not interchangeable. ln(e) = 1 and log₁₀(10) = 1, but ln(10) ≈ 2.3026 and log₁₀(e) ≈ 0.4343. Type a number into the wrong key and the result is silently wrong.

Binary log, log₂. Base 2, the heartbeat of computer science. It counts bits, the depth of a balanced tree, and the number of halving steps in a binary search. Reach for the Scientific Calculator for general arithmetic, but for these three named bases a dedicated tool saves you the mental juggling.

The change-of-base formula

Here is the practical problem: most calculators and programming languages only give you ln and log₁₀. They have no button for base 3, base 7, or base 60. The change-of-base formula fixes that in one line.

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

You can divide by any base you already own, so log₁₀ works just as well: log_b(x) = log₁₀(x) ÷ log₁₀(b). The two logs on top and bottom must share a base, and then the answer comes out in whatever base b you wanted.

Try base 2 of 8 through the formula: ln(8) ÷ ln(2) = 2.0794 ÷ 0.6931 = 3. It matches the count-the-twos answer exactly, which is the reassuring part — the formula is not a different rule, it is the same logarithm computed with tools you have. The Logarithm Calculator prints this division line under every result, so you see ln(x) over ln(b) rather than trusting a lone number.

I lean on this constantly when I am sanity-checking a spreadsheet. A cell uses LOG(x, base) and I am not sure the report is right. I punch the same x and base into the any-base mode, watch the ln(x) ÷ ln(b) line, and the mismatch tells me whether I fat-fingered the base argument or mistyped the number itself — not just that two figures disagree, but which input is the culprit. That extra signal has caught more of my own typos than I would like to admit.

Where logarithms earn their keep

Logarithms are not a classroom abstraction. They compress huge ranges into readable numbers, which is why so many real scales are logarithmic.

  • pH is −log₁₀ of the hydrogen-ion concentration. A pH of 5 is ten times more acidic than a pH of 6, because each unit is a full power of ten. To go from pH back to concentration you run the antilog: base 10, raised to the negative pH.
  • Decibels measure sound on a base-10 log scale. A 10 dB jump is ten times the power, a 20 dB jump is a hundred times, so a small-looking number hides an enormous physical range.
  • Algorithm complexity lives in base 2. A binary search over a million records needs about log₂(1000000) ≈ 20 comparisons, because each step halves the remaining list. That is why an O(log n) algorithm barely slows down as the data grows — twenty steps for a million, and only about thirty for a billion.

Logs and powers travel together in these settings, and so does their inverse. When you need the forward direction — raising a base to a big exponent, say in cryptography or hashing — the Modular Exponentiation tool handles the heavy lifting, while the logarithm gives you the exponent back. The same loop runs through the antilog button: enter a base and a log value, get the original number, and read pH, decibels, or the Richter scale straight off the scale they were stored on.

Wrapping up

A logarithm is just a power problem read backwards: log_b(x) answers "b to what power is x?" Three bases — log₁₀, ln, and log₂ — cover almost everything you will meet, and the change-of-base formula log_b(x) = ln(x) ÷ ln(b) lets one calculator reach any base at all. Keep the worked cases in your pocket, log₂(8) = 3 and log₁₀(1000) = 3, and the rest is bookkeeping. When you want the steps shown rather than a bare answer, run it through the Logarithm Calculator and check the division line yourself.


Made by Toolora · Updated 2026-06-13