Logarithm Calculator (log, ln, any base)
Work out log₁₀, ln, log₂ or a log in any base, up to 30 decimal places, with every step shown. You get exact answers when there is one (log₄ 2 = 1/2), and you can find x from its log or find a missing base. The log rules are worked with your own numbers.
log₁₀ 50 = ?
Any number above 0 except 1: 3, 1.05, 1/2, √2, e or π.
Whole numbers, decimals, fractions (1/8), scientific notation (2.5e-6 or 3×10^4), powers (10^-3, e^2), √2, e and π.
If logb x = y, then x = by. Negative and fractional values are fine.
Solves a × bkx + d = c. Leave k = 1 and d = 0 for the plain a × bx = c. Growth: 500 × 1.05x = 1,000 asks how many years 5% growth takes to double.
1 mW gives dBm. Power ratios use 10 × log₁₀.
Richter-style magnitudes (and today’s moment magnitude) are log scales: each whole step is 10 × the wave height and about 31.6 × the energy.
How your log is worked out
Your numbers: change of base finds the answer, then the three log rules use it.
- 1
Change of base
ln 50 ÷ ln 103.912 ÷ 2.3026≈ 1.69897
- 2
Product rule
log₁₀(50×2)= 1.69897 + 0.30103= 2
- 3
Quotient rule
log₁₀(50÷2)= 1.69897 − 0.30103≈ 1.39794
- 4
Power rule
log₁₀(50³)= 3 × 1.69897≈ 5.09691
Read more: the formula, worked examples, log rules and log scales
A logarithm is the power you need. logb x asks: “what power of b gives x?” So log₁₀ 1,000 = 3 because 103 = 1,000, and log₂ 8 = 3 because 23 = 8. A log undoes a power, and an antilog (a power) undoes a log. For powers and roots themselves, use the exponent calculator.
The formula
log base b of x = y means b^y = x
change of base: log_b x = ln x ÷ ln b = log₁₀ x ÷ log₁₀ b
antilog: x = b^y
find the base: b = x^(1 ÷ y)
a × b^(kx) + d = c gives x = log_b((c − d) ÷ a) ÷ k
pH = −log₁₀[H⁺]; dB = 10 × log₁₀(power ratio) or 20 × log₁₀(amplitude ratio)
Worked example
Find the log (the default): log₁₀ 50 asks which power of 10 gives 50. 101 = 10 and 102 = 100, so the answer is between 1 and 2. By change of base, log₁₀ 50 = ln 50 ÷ ln 10 = 3.9120230054 ÷ 2.3025850930 ≈ 1.6989700043. The characteristic (whole part) is 1 and the mantissa (decimal part) is 0.6989700043. The same number in other bases: ln 50 ≈ 3.9120230054 and log₂ 50 ≈ 5.6438561898.
Log rules with the default numbers (m = 2, k = 3): log₁₀(50 × 2) = 1.6989700043 + 0.3010299957 = 2 exactly, which is right because 50 × 2 = 100 = 102. log₁₀(50 ÷ 2) = 1.6989700043 − 0.3010299957 = 1.3979400086 (that is log₁₀ 25). log₁₀(503) = 3 × 1.6989700043 = 5.0969100130 (log₁₀ 125,000).
Exact answers: log₂ 8 = 3 since 23 = 8. log₁₀ 0.001 = −3 since 10−3 = 1 ÷ 1,000. log₄ 2 = 1/2 since 41/2 = √4 = 2.
Find x (antilog): log₁₀ x = 2.5 means x = 102.5 = 102 × 100.5 = 100 × 3.1622776602 ≈ 316.2277660168.
Find the base: logb 8 = 3 means b3 = 8, so b = 81/3 = 2.
Exponential equation: 500 × 1.05x = 1,000. Divide by 500: 1.05x = 2. Take log₁.₀₅ of both sides: x = ln 2 ÷ ln 1.05 = 0.6931471806 ÷ 0.0487901642 ≈ 14.2066990829.
pH: [H⁺] = 2.5 µmol/L = 0.0000025 mol/L. pH = −log₁₀ 0.0000025 ≈ 5.6020599913, so it is acidic. pOH = 14 − 5.6020599913 = 8.3979400087 (at 25 °C).
Log rules
| Rule | In symbols | Example |
|---|---|---|
| Product | log(xy) = log x + log y | log₂(8 × 4) = 3 + 2 = 5 |
| Quotient | log(x ÷ y) = log x − log y | log₂(8 ÷ 4) = 3 − 2 = 1 |
| Power | log(xk) = k × log x | log₂(82) = 2 × 3 = 6 |
| Change of base | logb x = ln x ÷ ln b | log₂ 50 = 3.9120 ÷ 0.6931 ≈ 5.6439 |
| Swap | logb x = 1 ÷ logx b | log₄ 2 = 1 ÷ log₂ 4 = 1/2 |
| Base and 1 | logb b = 1, logb 1 = 0 | log₇ 7 = 1, log₇ 1 = 0 |
| Undo | blog_b x = x | 10log 50 = 50 |
Handy logs
| x | log₁₀ x | ln x | log₂ x |
|---|---|---|---|
| 1 | 0 | 0 | 0 |
| 2 | 0.3010299957 | 0.6931471806 | 1 |
| 3 | 0.4771212547 | 1.0986122887 | 1.5849625007 |
| e ≈ 2.7182818285 | 0.4342944819 | 1 | 1.4426950409 |
| 5 | 0.6989700043 | 1.6094379124 | 2.3219280949 |
| 10 | 1 | 2.3025850930 | 3.3219280949 |
| 100 | 2 | 4.6051701860 | 6.6438561898 |
Log scales in real life
| Scale | Formula | One step means |
|---|---|---|
| pH (acidity) | pH = −log₁₀[H⁺], [H⁺] in mol/L | 1 pH lower = 10 × more H⁺ ions |
| Decibels (power) | dB = 10 × log₁₀(P ÷ P₀) | +10 dB = 10 × the power, +3 dB ≈ double |
| Decibels (voltage, sound pressure) | dB = 20 × log₁₀(A ÷ A₀) | +20 dB = 10 × the amplitude, +6 dB ≈ double |
| Earthquake magnitude | energy ratio = 101.5 × gap | +1 = 10 × the wave height, ≈ 31.6 × the energy |
pH here is the simple textbook formula. pOH = 14 − pH holds for water at 25 °C. Common decibel references: 1 mW (dBm), 1 W (dBW), 1 V (dBV) and 20 µPa for sound in air (dB SPL). The earthquake energy rule (about 31.6 × per whole magnitude) is the usual rule of thumb from the Gutenberg–Richter energy relation.
Logs on calculators and spreadsheets
On most calculators log means base 10 and ln means base e. For any other base, divide: logb x = ln x ÷ ln b. In Excel and Google Sheets, =LOG(50, 10), =LN(50) and =LOG10(50) do the same jobs, and =LOG(8, 2) gives 3.
How the answers stay exact
This calculator does not use your device’s rounded maths. It works with whole numbers of any size: ln is built from ln 2 and a fast series, eˣ from a series and repeated squaring, with about 45 spare digits, so every decimal place you ask for (up to 30) is right. Exact answers are found by checking powers with whole numbers, so log₄ 2 shows 1/2, not 0.4999999999.
Common questions
What is a logarithm in simple words?
A logarithm answers the question: what power do I raise the base to, to get this number? Since 10³ = 1,000, log₁₀ 1,000 = 3. Since 2³ = 8, log₂ 8 = 3. A log is the opposite of a power, the same way division is the opposite of multiplication.
What is the difference between log and ln?
They use different bases. log on most calculators means base 10 (the common log), so log 100 = 2. ln is the natural log, base e ≈ 2.718281828, so ln 50 ≈ 3.9120230054 while log₁₀ 50 ≈ 1.6989700043. Any log can be turned into another with change of base: log₁₀ x = ln x ÷ ln 10.
How do I work out a log with a different base on my calculator?
Use change of base: log_b x = ln x ÷ ln b, or log x ÷ log b with base-10 logs. For log₂ 50, type ln 50 ÷ ln 2 = 3.9120230054 ÷ 0.6931471806 ≈ 5.6438561898. Both versions give the same answer because the base you pick cancels out.
What is an antilog?
The antilog undoes a log: if log_b x = y, then x = b^y. The common antilog of 2.5 is 10^2.5 = 100 × √10 ≈ 316.2277660168. The antilog of −3 is 10^−3 = 0.001. On a calculator it is usually the 10ˣ or eˣ key.
Can you take the log of a negative number or 0?
Not as a real number. A positive base raised to any power always gives a positive answer, so no power can give 0 or a negative number. log 0 heads down to minus infinity, and logs of negative numbers only exist as complex numbers, which this calculator does not cover.
How do I solve an equation like 500 × 1.05ˣ = 1,000?
Get the power on its own, then take a log of both sides. Divide by 500 to get 1.05ˣ = 2, so x = log₁.₀₅ 2 = ln 2 ÷ ln 1.05 = 0.6931471806 ÷ 0.0487901642 ≈ 14.2066990829. So money growing 5% a year doubles in just over 14 years.
Related calculators
Made by Zulu Calculator, part of AlphaZulu LLC. Formulas are shown in full and rule figures are checked against official sources; see how we build calculators.