How to use the log calculator
- Leave “Find” on “The logarithm y” and enter the base b and the number x, or press 10, e or 2 to pick a common base.
- Read the answer: exact when it is a whole number or a fraction, otherwise to 12 significant digits. The check below it raises the base to that power to give x back.
- See the same number in base e, 10 and 2, and the steps, including the change of base.
- To go the other way, choose “The number x” for an antilog (b to the power y), or “The base b” to find which base gives a logarithm.
What a logarithm is
A logarithm answers the question “what power?”. The logarithm of x to base b is the power y you raise b to in order to get x: logb x = y means by = x. So log₂ 8 = 3 because 2³ = 8, and log₁₀ 0.001 = −3 because 10−3 = 0.001. Logarithms turn multiplication into addition and powers into multiplication, which is why they suit quantities that span huge ranges, such as the pH of a solution and sound levels in decibels.
The common bases: 10, e and 2
The NIST Digital Library of Mathematical Functions (DLMF), the US government’s reference for these functions, defines the logarithm to a general base. Natural logarithms have as base the unique positive number e = 2.71828 18284 59045 23536… for which ln e = 1, so loge z is written ln z; and the DLMF gives the common logarithm as log₁₀ z = ln z ÷ ln 10.
- Base 10, log₁₀ or log: the common logarithm, used for orders of magnitude, pH and decibels. Each step of 1 is a factor of 10.
- Base e, ln: the natural logarithm, which undoes ex and so appears wherever growth or decay is written with e, such as ert.
- Base 2, log₂: the binary logarithm, which counts doublings: log₂ 1024 = 10, because 1024 halves 10 times to reach 1.
The change of base formula
Many calculators have only ln and log₁₀ keys. The DLMF gives the change of base formula for any bases a and b other than 0 or 1: loga z = ln z ÷ ln a, or more generally loga z = logb z ÷ logb a. So log₂ 5 = ln 5 ÷ ln 2 = 2.32192809489. It also gives loga b = 1 ÷ logb a: swapping the base and the number turns the logarithm upside down, and indeed log₅ 2 = 0.430676558073, which is 1 ÷ 2.32192809489. The steps above show the change of base for every answer.
The rules of logarithms
The DLMF lists these identities for the natural logarithm; by the change of base they hold in any base b:
- Product: logb(xy) = logb x + logb y.
- Quotient: logb(x ÷ y) = logb x − logb y.
- Power: logb(xn) = n logb x for x above 0.
- Reciprocal: logb(1 ÷ x) = −logb x.
- Inverse: blogb x = x, and logb by = y.
The power rule is how the calculator handles roots and powers exactly: √8 is 81/2, so log₂ √8 = ½ × log₂ 8 = ½ × 3 = 3/2.
Exact answers
Many logarithms are whole numbers or simple fractions: log₄ 8 = 3/2 because 43/2 = 8, and log₉ 27 = 3/2 as well. Before giving a decimal, the calculator looks for a fraction with a denominator up to 12 that fits, and checks it with exact whole-number arithmetic: 43 = 82 = 64, so 43/2 = 8 exactly. When no such fraction exists, as for log₁₀ 2 = 0.301029995664, the logarithm is irrational and the answer is a decimal to 12 significant digits. Answers were compared with the mpmath library at 40 digits on 200 random inputs, from fractions and numbers just above 1 to numbers hundreds of digits long; rounded to 12 significant digits, every one matched.
How many digits a number has
A whole number x has one more digit than the whole-number part of log₁₀ x. The calculator shows this for whole numbers and powers: log₁₀ 21000 = 301.029995664, so 21000 has 302 digits. Because powers are kept as powers, numbers far too large for an ordinary calculator, such as 2^100000, work as well.
Logarithms of 0 and negative numbers
A positive base to any real power is positive, so no real logarithm of 0 or a negative number exists. As x approaches 0, log x falls without limit, toward minus infinity for any base above 1. In complex numbers, the DLMF defines the general logarithm of any nonzero number, with infinitely many values that differ by multiples of 2πi; for a negative x the calculator gives the principal value, ln |x| + πi divided by ln b. The base must also be above 0 and not 1: 1 to any power is 1, so log base 1 has no answer.
Antilogs and finding the base
The antilog reverses a logarithm: if logb x = y then x = by. With base 10, the antilog of 3 is 1000 and of −3 is 0.001; with base e, the antilog of 1 is e itself. To find the base instead, raise x to the power 1/y: if logb 81 = 4, then b = 811/4 = 3. Both come out exact where possible, so the base with logb 10 = 3 is shown as ∛10. ln 10, the factor between natural and common logarithms, is 2.30258509299.
Your numbers stay on your device
Everything is worked out in your browser. Nothing you type is sent anywhere or stored.
Frequently asked questions
What does log mean on a calculator?
On most calculators log means the common logarithm, base 10, and ln means the natural logarithm, base e. In some programming languages and higher mathematics, log on its own means the natural logarithm. This calculator writes the base out, as log₁₀ or ln, so there is no doubt.
How do I find a log with a base my calculator doesn’t have?
Use the change of base: log_b x = ln x ÷ ln b, or log x ÷ log b with base-10 logs. For example, log₂ 5 = ln 5 ÷ ln 2. Enter any base above in the base box, including fractions, e and roots such as √2.
Why is the log of a negative number or 0 undefined?
A positive base raised to any real power is positive, so no real exponent gives 0 or a negative number. As x shrinks toward 0, log x heads to minus infinity. In complex numbers a negative number does have logarithms; the calculator shows the principal value.
What is an antilog?
The antilog undoes a log: the antilog of y in base b is b to the power y. Choose “The number x” to find it; for example, the base-10 antilog of 3 is 1000.
Can I type powers, roots or very large numbers?
Yes. Enter powers such as 2^1000 or e^3, roots such as √8 or cbrt(27), fractions such as 1/8, and scientific notation such as 1e300. They are kept exact, so log₂ 2^1000 comes out as exactly 1000.
Is anything I type sent anywhere?
No. Everything is worked out in your browser, and nothing you type is sent anywhere or stored.