Logarithm Calculator
Calculate logarithms with different bases. Choose natural log (ln), common log (log base 10), or enter a custom base.
Quick Examples
What is a Logarithm?
A logarithm answers the question: "To what power must a base be raised to get a given number?" It is the inverse operation of exponentiation.
Types of Logarithms
- Common Log (log₁₀): Used in engineering, pH scale, decibels
- Natural Log (ln): Base e ≈ 2.71828. Essential in calculus and physics
- Binary Log (log₂): Important in computer science and information theory
Logarithm Rules
| Rule | Formula |
|---|---|
| Product Rule | log(xy) = log(x) + log(y) |
| Quotient Rule | log(x/y) = log(x) - log(y) |
| Power Rule | log(xⁿ) = n·log(x) |
| Change of Base | log_b(x) = ln(x)/ln(b) |
How the Logarithm Calculator Works
This calculator evaluates logb(x) for any base you choose. Enter a positive number, pick Common Log (base 10), Natural Log (base e), Binary Log (base 2), or a Custom Base, and click Calculate. The result appears with the formula used — for example, log₁₀(1000) = 3 because 10³ = 1000.
Two inputs are restricted for mathematical reasons: the number must be positive (logarithms of zero and negatives are undefined in real numbers), and a custom base must be positive and not equal to 1.
Worked Examples
Example 1: log₁₀(1000) = 3
Example 2: log₂(32) = 5
Example 3: log₂(1/8) = −3
Logarithms of numbers between 0 and 1 are negative — a useful pattern to recognize.
Example 4: log₁₀(0.001) = −3
Example 5: log₀.₅(8) = −3
Bases between 0 and 1 flip the sign: raising a fraction to a negative power gives a large number.
Example 6: Find the base — in which base is the log of 8 equal to 3?
Example 7: Find the argument — which number has log₁₀(x) = 3?
Example 8: Change of base — log₂(100)
No calculator has a "log₂" button, but every calculator has ln. Convert:
Check: 2^6.6439 ≈ 100. This is exactly what the calculator does internally for custom bases.
Logarithm Rules in Action
The rules table above becomes powerful when applied to real numbers:
- Product: log₁₀(200) = log₁₀(2 × 100) = log₁₀(2) + log₁₀(100) ≈ 0.30103 + 2 = 2.30103
- Quotient: log₁₀(1000 / 10) = log₁₀(1000) − log₁₀(10) = 3 − 1 = 2
- Power: log₁₀(100²) = 2 × log₁₀(100) = 2 × 2 = 4
- Condensing: 2·ln(3) + ln(2) = ln(3²) + ln(2) = ln(9 × 2) = ln(18) ≈ 2.8904
Logarithms Undo Exponentials (and Vice Versa)
Because logs and exponentials are inverse operations, they cancel in both directions:
- log₁₀(10^4.2) = 4.2 — the log strips the base-10 exponential bare.
- 10^(log₁₀(73)) = 73 — the exponential strips the log bare.
- ln(e^(−1.5)) = −1.5 — works for any real exponent, including negatives.
This round-trip property is what makes logarithms the standard tool for solving any equation where the unknown sits in an exponent.
Special Values Worth Memorizing
| Rule | Why | Example |
|---|---|---|
| logb(1) = 0 | b⁰ = 1 | log₁₀(1) = 0, ln(1) = 0 |
| logb(b) = 1 | b¹ = b | log₁₀(10) = 1, ln(e) = 1 |
| logb(bⁿ) = n | Inverse of bⁿ | log₂(2⁵) = 5, log₁₀(0.1) = −1 |
| logb(1/b) = −1 | b⁻¹ = 1/b | log₂(0.5) = −1 |
Why the Argument Must Be Positive (and the Base Cannot Be 1)
Two inputs are off-limits, and both restrictions come straight from the definition:
- Argument x > 0: b^y is always positive when b > 0, so no real exponent y can produce 0 or a negative number. That is why log(0) and log(−5) are undefined.
- Base b > 0, b ≠ 1: 1^y = 1 for every y, so a base-1 logarithm could never give a unique answer — log₁(5) would have to be every number at once.
Common Log vs. Natural Log: Which Should You Use?
| Name | Notation | Base | Used for |
|---|---|---|---|
| Common log | log₁₀, log, lg | 10 | Engineering, pH, decibels, Richter scale |
| Natural log | ln | e ≈ 2.71828 | Calculus, growth and decay, compound interest |
| Binary log | log₂, lb, ld | 2 | Computer science, information theory, bits |
Notation warning: a bare "log" usually means base 10 in engineering and school math, but base e in many university textbooks and programming languages. When the base matters, write it explicitly.
Where e Comes From: A Compound-Interest Story
Euler's number e ≈ 2.718281828 emerges from a simple question: what happens to $1000 invested at 100% annual interest as compounding gets more frequent? The growth factor is (1 + 1/m)^m, where m is the number of compounding periods:
| Compounding | m | Growth factor |
|---|---|---|
| Yearly | 1 | 2.000000 |
| Monthly | 12 | 2.613035 |
| Daily | 365 | 2.714567 |
| Hourly | 8760 | 2.718127 |
| Continuous | ∞ | 2.718282 (e) |
No matter how often you compound, the factor never exceeds e — it is the speed limit of 100% growth. That is why continuous growth uses base e, and why the natural logarithm ln is the natural choice for anything that grows or decays smoothly.
Estimating Logarithms Mentally: Characteristic and Mantissa
Before calculators, people split every common log into two parts: the characteristic (the integer part, read straight off the number of digits) and the mantissa (the decimal part, looked up in a table).
- Characteristic = 3 — 7320 has 4 digits, so its log is between 3 and 4.
- Mantissa ≈ 0.8645 — depends only on the digit sequence 7.32, not on where the decimal point sits.
That separation is why old log tables only listed mantissas: log₁₀(732), log₁₀(73.2), and log₁₀(7320) all share the mantissa 0.8645 and differ only in the characteristic (2, 1, and 3). Slide rules worked on the same principle — the mantissa is the distance along the rule.
Real-World Applications
- pH scale (chemistry): pH = −log₁₀[H⁺]. A hydrogen concentration of 10⁻⁷ mol/L gives pH 7 (neutral); each pH unit is a 10× change in acidity.
- Richter scale (seismology): each whole-number step means 10 times the wave amplitude — a magnitude 6 quake shakes 10× harder than a magnitude 5.
- Decibels (acoustics): dB = 10·log₁₀(I/I₀). Doubling sound intensity adds about 3 dB (10·log₁₀(2) ≈ 3.01); 10× the intensity adds exactly 10 dB.
- Bits (information theory): choosing among 8 equally likely outcomes carries log₂(8) = 3 bits of information.
- Log scales (data visualization): when data spans many orders of magnitude — earthquake energies, stellar brightness — a logarithmic axis keeps everything visible.
- Algorithm analysis (computer science): binary search halves the problem each step, so its cost grows like log₂(n).
A Short History of Logarithms
Logarithms were invented to turn the hardest arithmetic of the 1600s — multiplying and dividing huge numbers for astronomy and navigation — into simple addition. Scottish mathematician John Napier published the first logarithm tables in 1614 after twenty years of work; Henry Briggs then rebuilt them around base 10, the version scientists used for the next 350 years.
The word itself comes from Greek logos (ratio) and arithmos (number): "ratio-numbers." Edmund Gunter (1620) and William Oughtred (1622) engraved logarithms onto sliding rulers, creating the slide rule — the pocket calculator of engineers, scientists, and Apollo astronauts until electronic calculators arrived in the 1970s.
Solving Logarithmic Equations
Three strategies cover most equations: convert to exponential form, condense with log rules, and always check the domain at the end.
Equation 1: log₂(x) = 5
Equation 2: log(x) + log(x − 3) = 1
- Condense: log(x(x − 3)) = 1
- Exponentiate: x(x − 3) = 10¹ = 10
- Solve: x² − 3x − 10 = 0 → x = 5 or x = −2
- Check the domain: x = −2 makes log(x) undefined, so reject it. Answer: x = 5.
Equation 3: ln(x) = 2.5
Reading the Graph of y = logb(x)
- Always passes through (1, 0) — because logb(1) = 0 in every base.
- Vertical asymptote at x = 0 — the curve dives toward −∞ as x approaches 0 from the right.
- Rises when b > 1 (log₁₀, ln, log₂) and falls when 0 < b < 1 (log₀.₅).
- Domain is x > 0 only — there is no part of the graph left of the y-axis.
Common Mistakes to Avoid
- log(x + y) ≠ log(x) + log(y). The product rule works on multiplication inside the log, not addition. log(100 + 100) = log(200) ≈ 2.30, but log(100) + log(100) = 4.
- log(x) / log(y) ≠ log(x / y). Division of logs is the change-of-base formula in disguise: log(x)/log(y) = logy(x).
- Forgetting the domain when solving equations. Any candidate that makes an argument zero or negative must be rejected, as in Equation 2 above.
- Assuming "log" always means base 10. Check the field — mathematicians and many programming languages mean base e.
- Trying the log of zero or a negative. In real numbers these are undefined; the calculator will refuse them.