Logarithms are one of the fundamental tools of mathematics, used in physics, chemistry, computer science, economics and engineering. Despite their usefulness, many people struggle when calculating them. This article explains step by step what logarithms are, how to calculate them, and where they're used in practice.
What is a logarithm?
A logarithm answers the question: to what power must the base be raised to get a given number? Formally, the logarithm of a number b to base a is written as loga(b) = x, which means ax = b.
Example: log2(8) = 3, because 2³ = 8.
Types of logarithms
In practice we most often encounter three types of logarithms:
- Common (decimal) logarithm (log or log10) — base 10, widely used in the sciences and engineering. Notation:
log(100) = 2, because10² = 100. - Natural logarithm (ln) — base e ≈ 2.718, used in higher mathematics, physics and economics. Notation:
ln(e) = 1. - Binary logarithm (log2) — base 2, key in computer science and information theory. Notation:
log2(32) = 5, because2⁵ = 32.
Basic logarithm formulas and properties
Knowing the properties of logarithms significantly simplifies calculations. Here are the most important rules:
- Log of a product:
loga(x · y) = loga(x) + loga(y) - Log of a quotient:
loga(x / y) = loga(x) − loga(y) - Log of a power:
loga(xn) = n · loga(x) - Change of base:
loga(b) = log(b) / log(a) = ln(b) / ln(a) - Log of 1:
loga(1) = 0for any base a - Log of the base itself:
loga(a) = 1
How to calculate a logarithm step by step
Direct method
When the base and argument are powers of the same number, you can find the logarithm directly. Example: log3(81). We know that 81 = 3⁴, so log3(81) = 4.
Change-of-base method
When you can't determine the exponent directly, use the change-of-base formula:
log5(125) = ln(125) / ln(5) = 4.828 / 1.609 ≈ 3
On a calculator: enter ln(125), divide by ln(5) — the result is 3.
Logarithm with a calculator
Every scientific calculator has log (common logarithm) and ln (natural logarithm) buttons. To calculate a logarithm with a different base, use the change-of-base formula.
Domain and graph properties
The logarithmic function f(x) = loga(x) is defined only for x > 0. You cannot take the logarithm of a negative number or zero — the attempt will produce an error, both on a calculator and mathematically. The graph is monotonically increasing when a > 1 and decreasing when 0 < a < 1.
Practical applications of logarithms
- The Richter scale — each step is a 10-fold stronger earthquake (a logarithmic scale).
- Decibels (dB) — sound intensity measured on a logarithmic scale.
- pH of a solution — pH = −log[H⁺], the logarithm of hydrogen ion concentration.
- Compound growth — the doubling time of capital:
t = ln(2) / r, where r is the rate of return. - Algorithms — time complexity O(log n) describes the efficiency of binary search.
Common mistakes when calculating logarithms
Avoid these pitfalls:
- Confusing
log(x + y)withlog(x) + log(y)— the formula applies only to a product, not a sum. - Forgetting that
log(−5)doesn't exist for real numbers. - Getting the change of base backwards — always divide the logarithm of the argument by the logarithm of the base, not the other way around.
Use our logarithm calculator to instantly compute log, ln or log2 for any number.
FAQ — frequently asked questions about logarithms
What's the difference between log and ln?
log (without a stated base) usually means the common logarithm, base 10. ln is the natural logarithm, base e ≈ 2.718. In higher mathematics "log" often means ln, so always check the context.
How do you calculate a log without a calculator?
For simple values (e.g. log(1000) = 3, log(10) = 1) you can do it in your head. For other values, use logarithm tables or the change-of-base formula with the natural logarithm.
Can a logarithm be negative?
Yes. The logarithm of a number in the interval (0, 1) with a base greater than 1 is negative. E.g. log(0.01) = −2, because 10⁻² = 0.01.
What's an antilogarithm?
An antilogarithm is the inverse operation of a logarithm — it's exponentiation. If loga(x) = y, then the antilogarithm is ay = x.
How are logarithms used in computer science?
In computer science, the binary logarithm (log2) describes the computational complexity of algorithms. Searching a list of 1,000,000 items with binary search requires at most log2(1,000,000) ≈ 20 comparisons.
How does the change-of-base formula work?
The formula loga(b) = log(b) / log(a) lets you calculate a logarithm with any base using only the log or ln buttons available on a calculator. E.g. log7(343) = log(343) / log(7) = 3.
Does log(0) exist?
No. The logarithm of zero is undefined — it approaches negative infinity but never reaches it. The domain of the logarithmic function consists exclusively of positive numbers.
How are logarithms related to exponentiation?
Taking a logarithm and exponentiating are mutually inverse operations, similar to addition and subtraction. If 2³ = 8, then log2(8) = 3.
What does ln(e) mean?
ln(e) = 1, because the natural logarithm has base e, and the logarithm of a base always equals 1. Similarly, log(10) = 1.
When are logarithms used in economics?
The natural logarithm is used to calculate how long it takes to double an investment (the rule of 72), to model exponential growth, and in logarithmic regression when analyzing financial data.