What is a logarithm?
Logarithm Calculator
Evaluate logs in any base and see the log rules at work
What is a logarithm, in plain words?
A logarithm answers one question: what power do I need? log₁₀ 1000 asks "10 to what power is 1000?" The answer is 3, because 10 × 10 × 10 = 1000. The small number is the base, and the answer is the exponent.
Every log statement is an exponent statement written the other way round. OpenStax College Algebra defines the logarithm this way, for a base b that is positive and not 1. Being able to switch between the two forms is the key skill:
| Exponent form | Log form | Read as |
|---|---|---|
| 2³ = 8 | log₂ 8 = 3 | log base 2 of 8 is 3 |
| 3⁴ = 81 | log₃ 81 = 4 | log base 3 of 81 is 4 |
| 10² = 100 | log₁₀ 100 = 2 | log base 10 of 100 is 2 |
| 10⁻² = 0.01 | log₁₀ 0.01 = −2 | log base 10 of 0.01 is −2 |
| 5⁰ = 1 | log₅ 1 = 0 | log base 5 of 1 is 0 |
Notice two patterns: the log of 1 is always 0, whatever the base, and the log of a number between 0 and 1 is negative. You can't take the log of 0 or a negative number, because no power of a positive base gives one.
Common logs and natural logs
- log with no base written usually means base 10, the common logarithm. log 1000 = 3. Calculators label it log.
- ln means base e, the natural logarithm. e is a constant, about 2.718, that appears naturally in growth and decay. ln e5 = 5, and ln 20 ≈ 3.00, because e³ ≈ 20.
- log₂, base 2, is common in computer science, where it counts how many times you can halve something: log₂ 1024 = 10.
A base 10 log tells you the size of a number in powers of ten. A number with log 6.3 is between a million (10⁶) and ten million (10⁷). Try a question on powers of ten:
Write a tiny size as a power of ten, or a power of ten as a decimal.
Press Mark to have your answer marked in the Smallest Thing course.
The graph of a logarithm
Here x is the input and y is its base 10 log. It is zero at x = 1, reaches 1 at x = 10, and rises ever more slowly: x has to multiply by 10 for y to go up by just 1. It plunges towards minus infinity as x gets close to 0 and never touches the y-axis. It is the mirror image of y = 10x in the line y = x, because the two functions undo each other. Explore other bases in our Log Graph Calculator.
The log rules, and why they work
Because logs are exponents, the log rules are just the exponent rules in disguise. When you multiply powers of the same base you add the exponents, so when you multiply numbers you add their logs.
| Rule | In symbols | Example |
|---|---|---|
| Product rule | log(xy) = log x + log y | log 2 + log 5 = log 10 = 1 |
| Quotient rule | log(x/y) = log x − log y | log₂ 48 − log₂ 3 = log₂ 16 = 4 |
| Power rule | log(xⁿ) = n log x | log 10⁷ = 7 log 10 = 7 |
| Log of 1 | log 1 = 0 | ln 1 = 0 |
| Log of the base | log_b b = 1 | log₃ 3 = 1 |
| Change of base | log_b x = ln x ÷ ln b | log₃ 50 = ln 50 ÷ ln 3 ≈ 3.561 |
The rules only work for logs with the same base, and there is no rule for log(x + y). The change of base rule lets you work out a log in any base on a calculator that only has log and ln buttons. Our log calculator guide has more worked calculations.
Using logs to solve equations
Logs earn their keep when the unknown is in the exponent. To solve 3x = 40, take the log of both sides and use the power rule to bring x down:
A money example: £500 is saved at 4% interest a year. How long until it reaches £800? Each year multiplies the money by 1.04, so 500 × 1.04n = 800, which means 1.04n = 1.6. Taking natural logs, n = ln 1.6 ÷ ln 1.04 ≈ 11.98, so it takes 12 years. Check: 500 × 1.0412 ≈ £800.52.
Where logarithms are used
- pH in chemistry: pH is the negative log of the hydrogen ion concentration (OpenStax Chemistry). A concentration of 10−3 mol/dm³ is pH 3, and each step of 1 on the pH scale is a factor of 10.
- Decibels: sound level in decibels is 10 times the log of the intensity ratio (OpenStax Physics), so a sound 10 times more intense is 10 dB louder.
- Earthquake magnitudes use a log scale, so each whole number step is a much bigger quake.
- Computer science: binary search through a million sorted items takes about log₂ 1,000,000 ≈ 20 steps.
- Growth and decay: population growth, interest and radioactive half-life questions all need logs to find the time.
Logs were invented to save time. The Scottish mathematician John Napier published the first tables of logarithms in 1614, according to MacTutor. They turned slow multiplications and divisions into quick additions and subtractions, and astronomers such as Kepler used them in their calculations.
Common mistakes
- Splitting log(x + y). It is not log x + log y. The product rule is for log(xy).
- Dividing instead of finding a power. log₂ 32 is 5, not 32 ÷ 2.
- Cancelling the log in log 40 ÷ log 3. That is not log(40 ÷ 3); work out each log first.
- Taking the log of zero or a negative number. It isn't defined for real numbers.
- Mixing up log and ln. log is base 10 on most calculators; ln is base e.
- Using the rules across different bases. Change base first.
Common questions
What is a logarithm in simple terms?
What is the difference between log and ln?
Why are logarithms useful?
What is log of 1?
Can a logarithm be negative?
Who invented logarithms?
Revision cards
Read the front, say your answer, then flip to check.
Where to go next
- Solve it
Logarithm Calculator
Evaluate logs in any base and see the log rules at work
Open the tool - Learn it
Algebra
Master equations, inequalities and the language of abstract mathematics
Start the course - Test it
AP Precalculus
A new exam-style paper every day, with instant marking and a mark scheme
Start today's paper