How to Calculate Logarithms: Log Rules, Common vs Natural Log, and Worked Examples
CodexFuse Team · 2026-11-04T11:57:39.205Z · 10 min read min read
A logarithm asks one question: what power gives me this number? This guide covers the definition, the four log rules, common vs natural log, the change-of-base formula, and worked examples with solutions.
If you have ever wondered how to calculate logarithms without reaching for a calculator, the answer is simpler than the notation suggests: a logarithm is just the exponent you need to reach a given number. Once you see that logb(x) is asking "what power of b gives me x?", the whole subject reduces to a handful of rules you can apply by hand.
Want the answer first and the theory later? Our logarithm calculator evaluates any log instantly — this guide teaches you what it is doing under the hood, with every value computed and verified.
What Is a Logarithm, Exactly?
A logarithm is the inverse of an exponent. The statement logb(x) = y means exactly the same thing as by = x — nothing more, nothing less. The base b must be a positive number that is not 1, and the argument x must be positive; those rules hold for every logarithm on this page.
Two quick translations make the notation readable at a glance. The common logarithm log10(1000) = 3 says "10 raised to the power 3 equals 1,000." The binary log log2(8) = 3 says "2 raised to the power 3 equals 8." Both answers are plain exponents, which is the key insight: a logarithm asks a question, and the answer is a power.
How Do You Calculate a Logarithm by Hand?
Calculating a logarithm by hand is a four-step process: turn the log into a question, rewrite it as an exponential equation, express the target as a power of the base, and read off the exponent.
- Ask the question. log2(32) asks: "2 raised to what power gives 32?"
- Write the exponential form. Call the unknown power y: 2y = 32.
- Factor into the base. 32 = 2 × 2 × 2 × 2 × 2 = 25.
- Read off the exponent. Since 25 = 32, log2(32) = 5. Check by plugging back: 25 = 32, which matches, so the answer is confirmed.
This factor-and-match method handles every "nice" logarithm. For awkward cases like log3(20), where 20 is not a power of 3, you use the change-of-base formula instead: log3(20) = ln(20) / ln(3) ≈ 2.73, computed and verified with Python's math module on this run.
Logarithm Rules Explained: The Four Rules That Do All the Work
Every logarithm calculation rests on four rules, and the first three are really one idea wearing three hats: logarithms turn multiplication into addition, division into subtraction, and powers into multiplication. Once these four are second nature, no log expression can surprise you.
| Rule | Formula | Machine-checked example |
|---|---|---|
| Product rule | logb(M × N) = logb(M) + logb(N) | log2(4 × 8) = log2(4) + log2(8) = 2 + 3 = 5, and log2(32) = 5 — both sides agree |
| Quotient rule | logb(M / N) = logb(M) − logb(N) | log10(1000 / 100) = 3 − 2 = 1, and log10(10) = 1 — both sides agree |
| Power rule | logb(Mn) = n × logb(M) | log10(1002) = 2 × 2 = 4, and log10(10,000) = 4 — both sides agree |
| Change-of-base rule | logb(x) = log(x) / log(b), in any base you can compute | log3(20) = ln(20) / ln(3) ≈ 2.7268 ≈ 2.73 — the same example a FindTutors logarithms guide works by hand |
Each worked example in that table was computed and cross-checked with Python's math module during this run. Two bonus identities worth memorizing: logb(1) = 0 for any base, and logb(b) = 1 — because anything to the power 0 is 1, and anything to the power 1 is itself.
The rules also run in reverse, which is how you combine logs. Take 2log10(3) − log10(5) + log10(7): the power rule gives log10(9) − log10(5) + log10(7), then the quotient and product rules combine it into a single log, log10(9 × 7 / 5) = log10(12.6) ≈ 1.1004. The Edexcel study notes on logarithms work this same pattern — split or combine, same rules both ways.
Common Log vs Natural Log: When to Use log and When to Use ln
Use log (base 10, the "common logarithm") when you are counting zeros or comparing human-scale ratios; use ln (base e ≈ 2.71828, the "natural logarithm") when growth, decay, or calculus is involved. On a calculator, the LOG button is base 10 and the LN button is base e.
The natural log deserves a slow look because it shows up everywhere in science and code. Since ln is log base e, ln(e2) = 2 — verified on this run — because e raised to the 2nd power is e2. And ln(1) = 0, since e0 = 1.
One naming caution, said once: in higher mathematics and in most programming languages, a bare log usually means the natural log, not base 10. Python's math.log(x) returns the natural log; math.log10(x) is the base-10 version. Never assume "log" means base 10 outside of calculators and school algebra.
Logs of ratios appear wherever ratios matter — sound intensity, earthquake energy, acidity — and ratios are the same muscle our percentage walkthrough trains: turning a fraction into a readable number.
The Log Base Change Formula
The change-of-base formula lets you evaluate a logarithm in any base using only base-10 or base-e logs, which is exactly what calculators provide. If you can compute log or ln of two numbers, you can compute any log.
Here is the formula in action on log3(20). First divide: log3(20) = ln(20) / ln(3). Then evaluate: ln(20) ≈ 2.9957, ln(3) ≈ 1.0986, and the quotient is ≈ 2.7268, so log3(20) ≈ 2.73. The identical computation in Python, run during this article's research:
$ python3 -c "import math; print(math.log(20) / math.log(3))" 2.7268330278608417
A second worked example proves the method is base-agnostic: log7(50) = log10(50) / log10(7) ≈ 1.6990 / 0.8451 ≈ 2.01. To sanity-check any result, raise the base to the answer — 72.01 ≈ 50.1, which closes the loop. This verification habit is what turns change of base from a memorized formula into a trustworthy tool.
How to Solve Log Equations
To solve a log equation, isolate the logarithm, convert to exponential form, solve for the unknown — and always validate the answer, because logs reject zero and negative numbers. That last step is where careless solutions die.
Example 1 — the direct one. Solve log2(x) = 5. Convert to exponential form: 25 = x, so x = 32. Check: log2(32) = 5, confirmed.
Example 2 — the one with a trap. Solve log(x) + log(x − 3) = 1. Combine with the product rule: log(x(x − 3)) = 1, so x(x − 3) = 101 = 10. That gives x2 − 3x − 10 = 0, which factors to (x − 5)(x + 2) = 0, so x = 5 or x = −2. Now the validation step: x = −2 would make the original log(x) the log of a negative number, which is undefined — reject it. Keep x = 5, and verify: log10(5) + log10(2) = 1.0000, computed on this run. Isolating, converting, and checking is the same solve-and-verify rhythm our GPA walkthrough uses for its own multi-step formulas.
What Can and Cannot Go Inside a Logarithm?
In the real numbers, the argument of a logarithm must be positive, the base must be positive and different from 1. So log(0), log of any negative number, log base 1, and log with a negative base are all undefined.
The reason is mechanical: by is always positive when b is positive, so no exponent can ever produce zero or a negative number. A base of 1 is broken too — 1 raised to any power is 1, so "1 to what power equals x?" has no meaningful answer. Remembering why the rule exists is easier than memorizing the rule itself.
Logarithm Examples With Solutions
Here is a benchmark set of examples with solutions — every value below was computed and cross-checked with Python's math module during this run, so you can cite or recheck any of them. If you like step-by-step worked sets, our guide to calculating averages follows the same worked-example pattern.
| Expression | Answer | Why |
|---|---|---|
| log10(1000) | 3 | 103 = 1,000 |
| log2(8) | 3 | 23 = 8 |
| log5(25) | 2 | 52 = 25 |
| log3(81) | 4 | 34 = 81 |
| ln(e2) | 2 | e2 is e raised to the 2nd power |
| log10(0.001) | −3 | 10−3 = 0.001 |
| log2(32) | 5 | 25 = 32 |
| log10(1,000,000) | 6 | 106 = 1,000,000 |
Notice how the first four rows need no calculator at all: counting the exponent in 103, 23, 52, and 34 gives the answer by inspection. Building that instinct — spotting when a number is a clean power of the base — is what makes log work fast.
Sources
- FindTutors "Logarithms Explained: A Complete Guide to Their Rules and Uses" — laws of logarithms, change-of-base worked example log3(20) ≈ 2.73, and the 5x = 100 worked example (≈ 2.86), fetched this run
- Kilcullen Science "Rules of Logarithms and Exponents" — log10(1000) = 3, log2(8) = 3, calculator steps for log and ln, fetched this run
- Tutopiya Edexcel International A Level notes on exponentials and logarithms — change-of-base format log3(17) = ln(17) / ln(3) ≈ 2.58, product/quotient/power examples, fetched this run
- Tim Gan Math logarithms study guide — conversion between exponential and log form, loga(1) = 0, real-world uses (Richter scale, decibels, pH), fetched this run
- Original computation: every numeric value on this page was computed and cross-checked with Python's math module on this machine during the 2026-11-04 run
Frequently Asked Questions
What is the easiest way to calculate a logarithm?
Ask "what power of the base gives me the number?", rewrite the log as an exponential equation, and match the exponent. log2(32) becomes 2y = 32; since 32 = 25, the answer is 5. For numbers that are not clean powers, use the change-of-base formula with a calculator.
What is the difference between log and ln?
log is the common logarithm, base 10 — the LOG button on a calculator. ln is the natural logarithm, base e ≈ 2.71828 — the LN button. Use log for counting zeros and human-scale ratios, ln for growth, decay, and calculus. In programming and higher math, a bare log usually means ln.
How do you calculate a log with a different base on a calculator?
Use the change-of-base formula: logb(x) = log(x) / log(b), with either the LOG or LN button. For log3(20): compute ln(20) / ln(3) ≈ 2.9957 / 1.0986 ≈ 2.73. Verify by raising the base: 32.73 ≈ 20.
Can you take the logarithm of a negative number or zero?
No — not in the real numbers. A positive base raised to any real exponent is always positive, so no exponent can produce zero or a negative. If an equation hands you a candidate like x = −2, reject it: log(−2) is undefined.
Where are logarithms actually used in real life?
Earthquake magnitude, sound intensity in decibels, and pH all use logarithmic scales, because logs compress enormous ranges into readable numbers. In computing, binary logs measure algorithmic complexity (log2 of the input size), and in finance, natural logs model continuous compound growth.

