Here's a question: 2 raised to what power gives you 1,024?
You could probably get there by doubling in your head: 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024. Ten steps. So the answer is 10.
Now flip the question around. You're handed the number 1,024 and asked "how many times did 2 have to double itself to get here?" Same ten steps, same answer, but now you're working backwards from the result instead of forwards from the rule. That backwards question, "what power do I need?", is a logarithm. Nothing more mysterious than that.
We already spent time with the forward version of this idea in what an exponential function is and why it grows so fast. A logarithm is just that same doubling story, run in reverse.
What a logarithm actually counts
Think back to that pond with the doubling lily pad, or the chessboard with the doubling rice. Both of those stories start with a step count and ask you to find the total. A logarithm starts with the total and asks you to find the step count.
Say you're folding a sheet of paper in half, over and over. Each fold doubles how many layers thick it is. One fold, 2 layers. Two folds, 4 layers. Three folds, 8 layers. The question "how many folds until I have at least a million layers?" doesn't have an obvious answer just by staring at it. But you can find out by counting.
Pick a number. Press play and watch how many doublings, 1, 2, 4, 8... it takes to beat it. That count is a logarithm.
Drag the target up toward a million and press play. Watch how few folds it actually takes, the count barely moves even though the target grows by factors of ten. That's the first strange thing about logarithms: they grow incredibly slowly compared to the numbers they're measuring. Ten million is way, way bigger than a hundred, but log base 2 of ten million is only about 23, while log base 2 of a hundred is about 7. The logarithm cares about how many multiplications it took, not how big the pile got.
Naming the operation
Now that the idea is solid, let's put notation on it. We write "what power of gives me " as:
Read as "log base of ". It's just a name for the exponent you'd need. In the paper-folding example, (each fold doubles), and , meaning you'd need 20 whole folds to clear a million layers.
Every log is defined by an exponential equation hiding right behind it. If , then automatically . They're the same fact, written two different ways, for two different questions: "what do I get?" versus "how did I get here?"
The mirror-image trick
Because a logarithm undoes an exponential, the two of them have a specific geometric relationship: their graphs are mirror images of each other, reflected across the line .
Here's why that has to be true. If the point sits on the curve , that means . But by definition, that's exactly the same as saying , which means the point , with the coordinates swapped, sits on the curve . Swapping the coordinates of a point is precisely what reflecting across does.
Drag the dot along the blue curve. Its mirror image always lands on the amber curve, on the other side of the dashed diagonal.
Drag the dot along the blue exponential curve. Its reflection lands on the amber log curve every single time, no exceptions. An inverse function is just a function with its inputs and outputs swapped, and swapping inputs and outputs is the same as flipping the graph over the diagonal.
Why multiplication turns into addition
Here's the property that made logarithms genuinely useful long before calculators existed. Watch what happens to exponents when you multiply:
If you multiply two powers of the same base, you add the exponents. That's just what multiplying repeated factors does: is , five 2's multiplied together, which is .
Since a logarithm is an exponent, this rule flips into a rule about logs:
Multiplying two numbers is the same as adding their logs. This is the entire reason slide rules work, and the reason engineers used log tables for centuries before electronic calculators existed.
Drag the two markers. The blue length plus the amber length always lands exactly on a × b, because adding log-lengths multiplies values.
Drag the two markers. The blue segment has a length equal to , the amber segment has a length equal to , and they're laid end to end. Wherever that lands, that's , which is also exactly where sits on the same ruler. You just multiplied two numbers by adding two lengths.
Why we actually use logs
So multiplication becomes addition. Nice trick, but why does anyone care today, when computers multiply instantly? Because logs solve a second problem: some quantities in the real world span such a huge range that a normal, linear ruler can't display them usefully.
Sound intensity is a good example. A jet engine is roughly a million times more intense than a whisper. Try to put both of those on the same linear ruler from 0 to a million, and the whisper sits so close to zero it's indistinguishable from silence. The scale isn't wrong, it's just useless at that range.
Slide across six orders of magnitude. Watch the top marker vanish into the corner while the bottom marker keeps moving cleanly.
Slide across the full range. Watch the marker on the linear ruler get squeezed into the corner and basically disappear, while the marker on the log ruler keeps moving in even, readable steps the entire way. That's why decibels exist: takes a range that spans six orders of magnitude and compresses it down to a number between 0 and 130 that a dial can actually show. Richter scale for earthquakes and pH for acidity do the exact same trick, for the exact same reason.
Picking a base
You've probably noticed we kept using base 2. Any positive number besides 1 can be a base, and three show up constantly:
- Base 10, written or just : matches our number system, so reads off the number of zeros. Common in engineering and decibels.
- Base 2, written : matches doubling, so it shows up in computer science, where data structures that repeatedly split in half (like binary search) take about steps to search items.
- Base , written and called the natural log: this is the base where the growth-rate math from the exponential post works out cleanest, so it's the default in calculus and science.
They're all measuring the same underlying thing, just in different-sized units, the same way inches and centimeters both measure length. Converting between them is one formula:
If you want to see this base-switching put to real use, the math behind compound interest solves an actual doubling-time equation this exact way, taking the log of both sides to pull a variable out of an exponent.
The short version
A logarithm answers "what power do I need?", the reverse of what an exponential answers. That reversal makes its graph the mirror image of the exponential curve across . Because it's counting exponents, multiplying two numbers turns into adding their logs, which is the mechanism behind slide rules. And because it grows so much slower than the numbers it measures, it's the right tool whenever a quantity spans a huge range, sound, earthquakes, acidity, or the size of a search space.
The next time you see a scale that seems to compress huge numbers into small, even steps, decibels, the Richter scale, pH, check if it's a logarithm doing the work. It usually is.
All visualizations are interactive React components running entirely in your browser. No libraries beyond React, all curves computed and drawn live via SVG.