A logarithm answers the question: what power do I need? log₂(8) = 3 because 2³ = 8. Logs turn multiplication into addition and huge ranges into manageable numbers, which is why they show up in earthquake scales, sound levels, pH, finance and computer science. Our log calculator finds the logarithm of a number in any base, along with the natural log and the base-10 log. This guide explains how logarithms work and how to use them.
How to use the calculator
- Number: the value you want the log of. It must be positive.
- Base: the base of the logarithm, such as 10, 2 or e (2.71828…).
The default, log₁₀(1,000), is 3, with ln(1,000) ≈ 6.9078. For log₂(8) you get 3, with ln(8) ≈ 2.0794 and log₁₀(8) ≈ 0.9031.
What a logarithm means
- log₁₀(100) = 2, because 10² = 100
- log₂(32) = 5, because 2⁵ = 32
- log₅(1) = 0, because 5⁰ = 1
- log₁₀(0.01) = −2, because 10⁻² = 0.01
A logarithm is the inverse of an exponent, just as subtraction is the inverse of addition. The exponent calculator goes the other way.
Common bases
| Name | Base | Written | Used in |
|---|---|---|---|
| Common log | 10 | log or log₁₀ | Science, decibels, pH, Richter scale |
| Natural log | e ≈ 2.71828 | ln | Calculus, growth and decay, finance |
| Binary log | 2 | log₂ | Computer science, information theory |
The log rules
| Rule | Example |
|---|---|
| log(ab) = log a + log b | log 20 = log 2 + log 10 ≈ 0.301 + 1 |
| log(a ÷ b) = log a − log b | log 5 = log 10 − log 2 ≈ 0.699 |
| log(aⁿ) = n × log a | log 1,000 = 3 × log 10 = 3 |
| log_b(b) = 1 | log₇(7) = 1 |
| log_b(1) = 0 | ln(1) = 0 |
The product rule is why slide rules worked: adding lengths on a log scale multiplies the numbers.
Change of base
Most calculators only have ln and log₁₀ buttons. To find a log in any other base:
Example: log₂(8) = ln 8 ÷ ln 2 = 2.0794 ÷ 0.6931 = 3.
Example: log₃(50) = log 50 ÷ log 3 = 1.6990 ÷ 0.4771 ≈ 3.561. Check: 3^3.561 ≈ 50.
Solving for an unknown exponent
Logs let you solve equations where the unknown is a power.
How long to double money at 6% a year? Solve 1.06ⁿ = 2. Take logs of both sides: n × log 1.06 = log 2, so n = 0.30103 ÷ 0.02531 ≈ 11.9 years. The compound interest calculator applies this to savings, and the compound interest guide covers the rule of 72 shortcut.
How many half-lives until 1% remains? Solve 0.5ⁿ = 0.01: n = log 0.01 ÷ log 0.5 ≈ 6.64. The half-life calculator uses this.
Logarithmic scales in real life
- Decibels: sound level in dB = 10 × log₁₀(I ÷ I₀). Every 10 dB increase is ten times the intensity.
- Earthquakes: each whole step on the magnitude scale is about 10 times bigger in amplitude and around 32 times more energy.
- pH: pH = −log₁₀[H⁺]. Lemon juice at pH 2 is 100,000 times more acidic than water at pH 7.
- Computing: a binary search through 1,000,000 sorted items takes at most log₂(1,000,000) ≈ 20 steps. Each binary digit doubles the range of values.
- Charts: a log-scale axis shows steady percentage growth as a straight line.
Things to watch
- Only positive numbers have real logs. log(0) and log(−5) are undefined.
- The base must be positive and not 1.
- Logs of numbers between 0 and 1 are negative. log₁₀(0.5) ≈ −0.301.
- ln and log are different. ln(100) ≈ 4.605 while log₁₀(100) = 2. Check which one a formula expects.
Frequently asked questions
What is the difference between log and ln?
log usually means base 10, and ln means the natural log, base e ≈ 2.71828. They differ by a constant factor: ln(x) ≈ 2.3026 × log₁₀(x).
Why is the log of 1 always zero?
Because any base raised to the power zero is 1, so the power needed to make 1 is always 0.
Can a logarithm be negative?
Yes. The log of any number between 0 and 1 is negative, because you need a negative power to make a fraction.
How do I calculate log base 2?
Divide the natural log of the number by ln 2, or enter 2 as the base in the calculator.
Try it yourself
Run your own numbers with our free tool: Log calculator. No sign-up, and it works on any device.