How the log calculator works
A logarithm answers the question “what power do I raise the base to, to get this number?” log₁₀ 1000 = 3 because 10³ = 1000. The calculator solves the equation log_b(x) = y for any one of its three parts:
- Logarithm y: give the number x and pick a base: 10 (the common log), e (the natural log, ln), 2 (the binary log) or any other positive base except 1.
- Number x (the antilog): give the base and the exponent y, and it works out x = b^y. Very large or very small answers, such as 10⁵⁰⁰, are shown in scientific notation.
- Base b: give x and y, and it finds the base with b^y = x.
The result also lists ln x, log₁₀ x and log₂ x together, and the working shows the change of base with your numbers. For the inverse operation, roots, see the root calculator; for logs inside a longer expression, use the scientific calculator.
The definition and the change-of-base formula
log_b(x) = y ⇔ b^y = x
- b
- the base: positive and not 1
- x
- the number: positive
- y
- the logarithm (the exponent): any real number
Calculators have keys only for ln and log₁₀. Any other base comes from the change-of-base formula, which works with logs of any one base as long as the same one is used above and below the line:
log_b(x) = ln x ÷ ln b = log₁₀ x ÷ log₁₀ b
Solving for the other two parts follows from the definition: the number is x = b^y, and the base is b = x^(1 ÷ y), which can also be found from ln b = ln x ÷ y.
Why x must be positive and b cannot be 1. A positive base raised to any real power is positive, so no power of b is zero or negative: log(0) and logs of negative numbers are not defined in the real numbers. And every power of 1 is 1, so base 1 can never reach any other number.
Exact answers. In floating-point arithmetic ln 1000 ÷ ln 10 comes out as 2.9999999999999996 and ln 125 ÷ ln 5 as 3.0000000000000004. The calculator reads the numbers exactly as typed and checks candidate answers with whole-number arithmetic (5³ really is 125), so it reports 3, not a number a hair away from it. Fractions are found too: log₄ 8 = 3/2 because 4³ = 8², and log₈ 2 = 1/3.
Worked example: log₁₀ 1000
- 1000 = 10 × 10 × 10 = 10³, so log₁₀ 1000 = 3.
- The natural log of the same number: ln 1000 ≈ 6.907755279.
- Change of base: ln 1000 ÷ ln 10 ≈ 6.907755279 ÷ 2.302585093 = 3.
- Its binary log: log₂ 1000 = 3 ÷ log₁₀ 2 ≈ 9.965784285, just under 10 because 2¹⁰ = 1024.
Other bases. log₂ 1024 = 10 and log₁₀ 0.001 = −3 exactly (10⁻³ = 1/1000). For a base with no key, log₃ 243 = ln 243 ÷ ln 3 = 5, because 3⁵ = 243.
Solving for the other parts. The antilog of 3 in base 10 is 10³ = 1000. If log_b 1000 = 3, the base is 1000^(1/3) = 10.
Where logarithms are used
Logarithms turn questions about repeated multiplication into questions about counting. The clearest everyday case is growth: money earning a steady rate r per period is multiplied by (1 + r) each period, so the number of periods needed to double it is:
n = log(2) ÷ log(1 + r)
At 7% per year that is ln 2 ÷ ln 1.07 ≈ 10.24 years. The familiar rule of 72 (72 ÷ 7 ≈ 10.29) is a quick approximation of the same logarithm. The compound interest calculator shows the balance year by year.
In this calculator, choose Other as the base, enter 1.07 and set x to 2 to get the same 10.24. Very large and very small numbers are also easier to handle as powers of ten; see the scientific notation calculator.
Limits
x and a custom base can be up to 10³⁰⁰, and y can be from −1,000,000 to 1,000,000. Only real logarithms are calculated; logs of negative numbers exist only as complex numbers and are not covered. Exact answers are found when the result is a whole number or a fraction with a denominator up to 12 and the powers involved stay below about 1,200 digits; other answers are shown to about 10 digits.
Frequently asked questions
What is the difference between log and ln?
log usually means the common logarithm, base 10, and ln is the natural logarithm, base e ≈ 2.718281828. They differ only by a constant factor: ln x = log₁₀ x × ln 10 ≈ 2.302585093 × log₁₀ x.
How do I calculate a log with a different base?
Use the change-of-base formula: log_b x = ln x ÷ ln b, or equally log x ÷ log b with base-10 logs. For example log₃ 243 = ln 243 ÷ ln 3 = 5.
What is an antilog?
The antilog reverses a logarithm: if log_b x = y, the antilog of y is x = b^y. The base-10 antilog of 3 is 10³ = 1000, and the natural antilog of 1 is e ≈ 2.718281828.
Why is the log of zero or a negative number not defined?
Because no power of a positive base is zero or negative. b^y gets close to 0 as y becomes very negative but never reaches it, so there is no real y with b^y = 0 or b^y = −5.
What is log base 2 used for?
It counts how many times a number can be halved or doubled, so it appears in computing (bits needed to represent a number, steps in a binary search) and in anything that doubles. log₂ 1024 = 10 because 1024 is 2 doubled nine times.
Sources
Last reviewed September 19, 2026