Logarithm Calculator
log base 10, natural log (ln), log base 2, or any custom base — with change-of-base derivation, exact-form recognition, and step-by-step working.
Calculating...
Select a base, enter x, and click Calculate.
What Is a Logarithm?
A logarithm is the inverse of exponentiation. If b^y = x, then log_b(x) = y. The question a logarithm asks is: "What power do I raise b to in order to get x?" For example, log₁₀(1000) = 3 because 10³ = 1000. That single relationship — exponent and logarithm as mirror operations — underpins almost every logarithm calculation you will ever do.
Logarithms appear in an enormous range of fields. The Richter scale measures earthquake energy on a base-10 log scale. Sound intensity in decibels uses log₁₀. Chemical pH — the measure of acidity — is the negative log₁₀ of hydrogen ion concentration. The natural log (base e) governs continuous growth and decay in biology, finance, and physics. And the binary log (base 2) is the backbone of computer science, from algorithm complexity to data compression to information entropy.
Despite this breadth, there are really only a handful of formulas to know: the definition, the change-of-base formula, and the three arithmetic rules — product, quotient, and power. This calculator works through all of them for any input you provide.
Logarithm Formulas at a Glance
Definition — Inverse of Exponentiation
log_b(x) = y ⟺ b^y = x
Example: log₁₀(1000) = 3 ⟺ 10³ = 1000
Change-of-Base — Natural Log Form
log_b(x) = ln(x) / ln(b)
Example: log₂(64) = ln(64) / ln(2) = 4.1589 / 0.6931 = 6
Change-of-Base — Common Log Form
log_b(x) = log₁₀(x) / log₁₀(b)
Example: log₂(64) = log₁₀(64) / log₁₀(2) = 1.8062 / 0.3010 = 6
Antilogarithm — Inverse Operation
antilog_b(y) = b^y
Example: antilog₁₀(3) = 10³ = 1000
Common Logarithm (log base 10)
When scientists and engineers write "log" without a base, they almost always mean log base 10 — the common logarithm. It is the natural choice for scales that span many orders of magnitude, because each unit increase represents a tenfold change.
pH chemistry: pH = −log₁₀([H⁺]). A solution with [H⁺] = 0.001 mol/L has pH = −log₁₀(0.001) = 3. Each integer step on the pH scale is a 10× change in hydrogen ion concentration. Sound (decibels): L = 10 × log₁₀(I/I₀), where I₀ is the threshold of hearing. A 10 dB increase means 10× more intensity. Earthquakes (Richter): each unit increase represents roughly 31.6× more energy released.
Key values to memorize: log₁₀(1) = 0, log₁₀(10) = 1, log₁₀(100) = 2, log₁₀(1000) = 3, log₁₀(0.1) = −1. These follow directly from the definition: 10^n = 10ⁿ.
Natural Logarithm (ln)
The natural logarithm uses base e ≈ 2.71828, Euler's number. It is "natural" because it arises spontaneously in calculus: the derivative of ln(x) is simply 1/x, which makes it the ideal tool for integration, differential equations, and growth models.
Continuous compounding: if you invest $1 at 100% annual interest compounded continuously, after one year you have e ≈ $2.718. The formula A = Pe^(rt) uses ln to solve for time: t = ln(A/P) / r. Population growth: N(t) = N₀·e^(rt) — the natural log extracts the growth rate or time from any exponential process. Entropy: information entropy in physics is defined using ln.
Key values: ln(1) = 0, ln(e) = 1, ln(e²) = 2, ln(e^n) = n. The natural log is the inverse of the exponential function: ln(e^x) = x and e^(ln x) = x.
Binary Logarithm (log base 2)
The binary logarithm counts the number of times you can halve a quantity before reaching 1, or equivalently, the number of bits needed to represent n distinct values. It is fundamental to computer science, information theory, and algorithm analysis.
Algorithm complexity: binary search halves the search space each step, so a search over n items takes log₂(n) comparisons. Sorting n items takes O(n log₂ n) comparisons. Information entropy: a fair coin toss carries log₂(2) = 1 bit of information; choosing uniformly from 8 options carries log₂(8) = 3 bits. Data structures: a balanced binary tree of n nodes has depth ≈ log₂(n).
Key values: log₂(1) = 0, log₂(2) = 1, log₂(4) = 2, log₂(8) = 3, log₂(16) = 4, log₂(1024) = 10. Powers of 2 always produce clean integer results.
Change-of-Base Formula
Most scientific calculators only have buttons for log₁₀ and ln. To compute log_b(x) for any other base b, you use the change-of-base formula:
log_b(x) = ln(x) / ln(b)
log_b(x) = log₁₀(x) / log₁₀(b)
Derivation: let y = log_b(x), so b^y = x. Take the natural log of both sides: ln(b^y) = ln(x). Apply the power rule: y·ln(b) = ln(x). Divide both sides by ln(b): y = ln(x)/ln(b). That is all — the change-of-base formula is a direct consequence of the power rule for logarithms.
Example: log₃(81). Since ln(81) ≈ 4.3944 and ln(3) ≈ 1.0986, log₃(81) = 4.3944 / 1.0986 = 4. Verification: 3⁴ = 81 ✓. This calculator shows both the ln-form and the log₁₀-form of the derivation so you can verify using whichever reference base your calculator provides.
Logarithm Properties and Rules
These identities hold for any valid base b (b > 0, b ≠ 1) and positive arguments x, y.
| Rule | Formula | Example |
|---|---|---|
| Product | log_b(x·y) = log_b(x) + log_b(y) | log₂(4·8) = 2 + 3 = 5 |
| Quotient | log_b(x/y) = log_b(x) − log_b(y) | log₁₀(100/10) = 2 − 1 = 1 |
| Power | log_b(xⁿ) = n · log_b(x) | log₁₀(10³) = 3 · 1 = 3 |
| Identity | log_b(b) = 1 | log₅(5) = 1, ln(e) = 1 |
| Log of 1 | log_b(1) = 0 | log₇(1) = 0, log₁₀(1) = 0 |
| Inverse | b^(log_b(x)) = x | 10^(log₁₀(x)) = x |
Logarithm Calculator FAQ
What is the difference between log and ln?
"log" (without a stated base) conventionally means log base 10 in science and engineering, and log base e in pure mathematics. "ln" unambiguously means the natural logarithm with base e ≈ 2.71828. The two are related by ln(x) = log₁₀(x) / log₁₀(e) ≈ log₁₀(x) / 0.4343, or equivalently log₁₀(x) = ln(x) × log₁₀(e) ≈ ln(x) × 0.4343. This calculator treats "log" as log₁₀ and shows "ln" explicitly as a separate option.
How do I calculate log of any base on a calculator?
Use the change-of-base formula: log_b(x) = ln(x) / ln(b). On any scientific calculator with an "ln" button, compute ln(x), then divide by ln(b). For example, log₃(81) = ln(81) / ln(3) ≈ 4.3944 / 1.0986 = 4. You can equally use the "log" (base 10) button: log₃(81) = log(81) / log(3) ≈ 1.9085 / 0.4771 = 4. Both routes give the same answer.
What is the change-of-base formula?
log_b(x) = log_a(x) / log_a(b), where a is any convenient reference base (usually e or 10). It lets you convert any logarithm to one your calculator can compute. The formula is derived by applying the power rule for logarithms to the definition b^y = x: take log_a of both sides to get y·log_a(b) = log_a(x), then divide by log_a(b) to isolate y = log_a(x) / log_a(b).
Why is log of a negative number undefined?
No real number raised to any real power produces a negative result when the base is positive. Since b^y is always positive for real b > 0 and real y, the equation b^y = x has no real solution when x ≤ 0. Logarithms of negative numbers do exist in the complex number system (involving imaginary parts), but real-valued logarithms require x > 0.
What is an antilogarithm (antilog)?
The antilogarithm is the inverse of the logarithm — it raises the base to the given power. antilog_b(y) = b^y. For base 10: antilog₁₀(3) = 10³ = 1000. For the natural log: antilog_e(2) = e² ≈ 7.389. If you know log₁₀(x) = 2.5, then x = 10^2.5 ≈ 316.23. Antilogs are used to reverse logarithmic scales back to linear values — for example, converting a pH reading back to hydrogen ion concentration.
What is log base 2 used for in computing?
log₂ counts the number of doublings — or equivalently, the number of binary digits (bits) needed. The number of bits to store n distinct values is ⌈log₂(n)⌉. Binary search on a sorted list of n items takes at most ⌈log₂(n)⌉ comparisons. Quicksort and mergesort have average time complexity O(n log₂ n). Information entropy H = −Σ p·log₂(p) measures the average bits per symbol in a message. Essentially any algorithm that halves the problem size repeatedly has a log₂ complexity.
Related Calculators
Scientific Notation Converter
Convert numbers to and from scientific notation with steps
Compound Interest Calculator
Future value and growth — uses natural log for continuous compounding
Quadratic Formula Calculator
Solve ax² + bx + c = 0 with real and complex roots
Factorial Calculator (n!)
Compute n! — Stirling's approximation uses ln
P-Value Calculator
Convert z, t, F, and chi-square statistics to p-values
Percentage Calculator
Percentage of a number, increase, and decrease