A logarithm is division for exponents
Multiplication asks how many copies of one number fit inside another. A logarithm asks the same question about repeated multiplication. How many times do you multiply by 2 to get from 1 to 1024? Ten times, so log₂(1024) is 10. Every logarithm problem reduces to counting steps of this kind, and the answer is allowed to be fractional because a partial step is still a defined amount of multiplying.
Three pieces are always in play: a base, a number and an exponent. Write the exponential form and the logarithmic form side by side and you see the identical information, rearranged.
by = xlogb(x) = yThe three modes at the top of the page match the three ways to be stuck. You know the base and the number and want the exponent. You know the base and the exponent and want the number, an operation older textbooks call the antilogarithm. Or you know the number and the exponent and want the base, which is a root wearing different clothes.
Picking the base you need
Four bases cover almost everything anyone types into a log calculator, and each earns its place in a different field.
| Base | Written as | Turns up in | One step means |
|---|---|---|---|
| 10 | log or log₁₀ | pH, decibels, Richter, order-of-magnitude estimates | Ten times bigger |
| e (2.71828…) | ln | Continuous growth, half-lives, calculus, statistics | One time constant of growth |
| 2 | lg or log₂ | Binary sizing, search trees, information entropy, audio octaves | Twice as big |
| 16 | log₁₆ | Hex field widths, colour codes, memory addressing | One hex character wider |
Base e looks arbitrary next to the round numbers, and it draws the most questions. It wins wherever growth is continuous rather than stepwise. Money compounding every instant, a population breeding year round, a hot mug shedding heat every moment. Write any of those with base e and you get a rate constant you differentiate without dragging a conversion factor along.
Change of base, and why one calculator covers every base
Hardware and language runtimes ship two logarithms, natural and base 10. Everything else comes out of one identity.
logb(x) = ln(x) / ln(b) = log10(x) / log10(b)Both divisions land on the same answer, and this page runs the natural log version. To get log₂(1000) by hand, take ln(1000) = 6.907755 and divide by ln(2) = 0.693147, giving 9.965784. The reading is direct: 1000 sits a hair under ten doublings above 1, which lines up with 210 = 1024 sitting a hair above 1000. Memorising a table of logs for every base was the old alternative, and this identity is why nobody has needed one since.
The five rules worth keeping in your head
Logarithms convert each operation into the one below it. Multiplication becomes addition, division becomes subtraction, powers become multiplication. Slide rules ran on the first line of this table for three centuries.
| Rule | Statement | Worked example |
|---|---|---|
| Product | log(xy) = log(x) + log(y) | log₂(8 × 4) = 3 + 2 = 5 |
| Quotient | log(x/y) = log(x) − log(y) | log₁₀(1000/10) = 3 − 1 = 2 |
| Power | log(xn) = n × log(x) | log₁₀(100³) = 3 × 2 = 6 |
| Root | log(ⁿ√x) = log(x) / n | log₂(√64) = 6 / 2 = 3 |
| Reciprocal | log(1/x) = −log(x) | log₁₀(0.01) = −2 |
Two constants fall out of the definition and catch people during checks. logb(1) is always 0, because raising anything to the zero power gives 1. And logb(b) is always 1. A result contradicting either one means the base and the number went into the wrong boxes.
Scales built on logarithms compress ranges no linear axis survives
Sound pressure between a whisper and a jet engine spans a factor near a trillion. Plot it linearly and the whisper disappears. Take a log first and the whole range fits in three inches of paper, which is why so many physical measurements arrive already logarithmic.
| Scale | Definition | A step of 1 unit |
|---|---|---|
| pH | −log₁₀[H⁺] | Ten times the hydrogen ion concentration |
| Decibels (power) | 10 × log₁₀(P/P₀) | About 1.26 times the power |
| Richter | log₁₀ of wave amplitude | Ten times the shaking, near 31.6 times the energy |
| Stellar magnitude | −2.5 × log₁₀ of brightness | Roughly 2.512 times dimmer as the number rises |
| Musical octave | log₂ of the frequency ratio | Double the frequency |
Notice the sign on pH and magnitude. Both carry a minus in front, so the friendlier number belongs to the larger quantity. A pH of 3 beats a pH of 6 for acidity by a factor of a thousand, and a magnitude 1 star outshines a magnitude 6 one.
Reading the growth panel
Take a balance of 1000 growing 7 percent a year and ask when it reaches 2000. The ratio is 2, one growth step is 1.07, and ln(2) divided by ln(1.07) gives 10.24 years. Compounding lands once a year, so the balance falls short at year 10 and clears the target at year 11. The panel reports both readings for this reason.
The rule of 72 shortcut divides 72 by the percentage rate and gets 10.29 here, close enough for mental arithmetic. It drifts once rates climb. At 25 percent the rule says 2.88 periods and the logarithm says 3.11, an error near 8 percent. Below roughly 15 percent the shortcut holds up fine.
Where this calculator stops
Being clear about the edges keeps you from trusting a number the page was never built to produce.
- Zero and negative numbers return nothing. No real exponent turns a positive base into a negative result, and the value falls toward negative infinity as the input approaches zero. Complex logarithms handle those inputs and sit outside this page.
- Base 1 is rejected. 1 raised to any power stays 1, so the change of base formula divides by zero. Negative bases are refused for a related reason.
- Precision runs out around 15 significant figures. The browser works in double precision floats, so asking for 10 decimals on a huge input prints digits the format cannot back up. Number theory and cryptographic work want an arbitrary precision library instead.
- Answers you expect to be whole sometimes are not. log₂(8) is exactly 3 on paper and frequently 2.9999999999999996 in floating point. Round the display before comparing two results for equality.
- Inputs above 1e308 overflow. Past that limit JavaScript reads infinity. Split the number into a mantissa and a power of ten, take the log of each part, then add them.
Checking an answer in five seconds
Every result carries its own proof, which is why the exponential form sits beside the readout. Raise the base to the answer and the number should come back. Beyond that, bracket the result against powers you already know. log₂(1000) has to land between 9 and 10, since 2⁹ is 512 and 2¹⁰ is 1024. A number smaller than the base always gives a logarithm under 1, and a number below 1 always gives a negative one. Those three checks catch nearly every mis-typed base.
