How to use the log calculator
- Choose what to find. “Logarithm” answers “what power of the base gives this number?” “Antilog” goes the other way and raises the base to a power.
- Pick the base. Base 10 is the common log, written log. Base e is the natural log, written ln. Base 2 is common in computing. “Other base” takes any positive number except 1.
- Enter the number. Logarithms are defined only for positive numbers. The results show the log in your base plus the common, natural and binary logs of the same number.
The calculator opens on log(500) ≈ 2.69897, from the earthquake example below: 10 raised to that power is 500.
What a logarithm is
A logarithm is an exponent. OpenStax’s Algebra and Trigonometry 2e (section 6.3) defines it this way: for a base b greater than 0 and not equal to 1,
So to evaluate a log, ask what exponent turns the base into the number. The textbook’s examples:
- log₄(64) = 3, because 4³ = 64 (Example 3).
- log₃(1/27) = −3, because 3⁻³ = 1/27 (Example 4).
- log(1,000) = 3, because 10³ = 1,000 (Example 5).
- log(321) ≈ 2.5065, between 2 and 3 because 321 is between 100 and 1,000 (Example 6).
- ln(500) ≈ 6.2146 (Example 8).
Because a positive base raised to any power is positive, the log of zero or a negative number is undefined. And since b⁰ = 1, the log of 1 is 0 in every base.
The change-of-base formula
Most handheld calculators have only two log keys, LOG for base 10 and LN for base e. To find a log in another base, divide (section 6.5):
Example 14 evaluates log₂(10) = ln 10 ÷ ln 2 ≈ 2.302585 ÷ 0.693147 ≈ 3.3219. Using base-10 logs gives the same answer: 1 ÷ 0.30103 ≈ 3.3219. The calculator shows the natural-log version of this division under “Change of base.”
Log rules
Because logs are exponents, the exponent rules turn into log rules. For positive M and N:
| Rule | Formula | Example (base 10) |
|---|---|---|
| Product | log(MN) = log M + log N | log 2 + log 50 = log 100 = 2 |
| Quotient | log(M/N) = log M − log N | log 500 − log 5 = log 100 = 2 |
| Power | log(Mᵏ) = k log M | log(10⁴) = 4 log 10 = 4 |
| Inverse | log_b(bˣ) = x and b^(log_b x) = x | 10^(log 500) = 500 |
The product rule is the reason logs were once used to multiply large numbers: adding two logs and looking up the antilog gives the product.
Logarithmic scales
Logs compress huge ranges into small numbers, so several everyday scales are logarithmic. Each step of 1 on a base-10 scale is a factor of 10.
- Earthquakes: the textbook compares two earthquakes, one releasing 500 times the energy of the other. The difference in magnitude solves 10ˣ = 500, so x = log 500 ≈ 2.699 (Example 7). In the other direction, a magnitude 8 is 10⁸⁻⁴ = 10,000 times a magnitude 4.
- pH: pH = −log[H⁺], the negative log of the hydrogen-ion concentration. Doubling the concentration lowers the pH by log 2 ≈ 0.301 (section 6.5, Example 12).
- Doublings: log₂ counts how many times something doubles. log₂(1,024) = 10, so 1,024 is ten doublings of 1.
Antilog: undoing a log
The antilog is the inverse of a log: raise the base to the log value. The antilog of 2.699 in base 10 is 10^2.699 ≈ 500, and the antilog of 3 in base 2 is 2³ = 8. Switch the calculator to “Antilog” and enter the exponent. Because logs are often rounded, an antilog can come back slightly off; 10^2.699 is 500.03, not exactly 500.
Solving for an exponent
The main practical use of logs is finding an unknown exponent. To solve bˣ = y, take the log of both sides and divide:
- 2ˣ = 20: x = log 20 ÷ log 2 ≈ 1.30103 ÷ 0.30103 ≈ 4.3219. Check: 2⁴ = 16 and 2⁵ = 32, so an answer between 4 and 5 makes sense.
- 3ˣ = 50: x = ln 50 ÷ ln 3 ≈ 3.9120 ÷ 1.0986 ≈ 3.5609.
- Halvings: how many times must 1 be halved to fall below 0.01? Solve (1/2)ˣ = 0.01: x = log 0.01 ÷ log 0.5 ≈ 6.64, so 7 halvings.
Enter y as the number and b as the base in this calculator to get x in one step. Then switch to Antilog and raise the base to that x to confirm you land back on y.
The natural log and e
The natural logarithm uses the base e ≈ 2.71828, a constant that appears whenever something grows or decays continuously at a rate proportional to its size. The textbook notes that most values of ln x can be found only with a calculator; the major exception is ln 1 = 0. Two values worth remembering are ln 2 ≈ 0.6931 and ln 10 ≈ 2.3026. The second links the two common bases: ln x = 2.3026 × log x, so ln 1,000 = 2.3026 × 3 ≈ 6.9078.
In calculus and the sciences, an unlabeled “log” often means ln, while engineering and school algebra use log for base 10. When a formula is ambiguous, check its source; this calculator labels the base on every result.
Common mistakes
- Splitting a log over addition. log(a + b) is not log a + log b. The product rule applies to log(ab).
- Dividing logs the wrong way. log a ÷ log b is the change-of-base formula for log_b(a), not log(a/b). log(1,000) ÷ log(10) = 3, while log(1,000/10) = log 100 = 2.
- Mixing bases. Use the same base, either both log or both ln, for the top and bottom of a change-of-base division.
- Forgetting the domain. In an equation such as log(x − 3) = 1, any solution must keep x − 3 positive. Here 10¹ = x − 3 gives x = 13, which works; an answer that makes the argument zero or negative must be thrown out.
- Calculator mode slips. Some calculators need the closing parenthesis, as in log(500), before you press Enter; leaving it off can apply the log to the wrong part of a longer expression.
Sources & assumptions
How this calculator gets its numbers. Full method: our methodology.
- log_b(x) is defined for x > 0 and a base b > 0 with b ≠ 1.
- Bases other than 10, e and 2 use the change-of-base formula log_b(x) = ln x ÷ ln b.
- When x is an exact power of the base, the whole-number answer is shown exactly.
Sources
- OpenStax (Rice University), Algebra and Trigonometry 2e, 6.3 Logarithmic Functions. Definition y = log_b(x) ⇔ bʸ = x; Example 3, log₄ 64 = 3; Example 4, log₃(1/27) = −3; Example 7, log 500 ≈ 2.699 (Richter scale); Example 8, ln 500 ≈ 6.2146.
- OpenStax (Rice University), Algebra and Trigonometry 2e, 6.5 Logarithmic Properties. Product, quotient and power rules, the change-of-base formula (Example 14: log₂ 10 ≈ 3.3219) and pH (Example 12: doubling [H⁺] lowers pH by about 0.301).
Last reviewed . Results are shown to 10 significant digits.
Frequently asked questions
What is the difference between log and ln?
log usually means base 10, the common logarithm. ln is the natural logarithm, base e ≈ 2.71828. log(1,000) = 3, while ln(1,000) ≈ 6.9078.
How do I calculate a log with a different base?
Divide the natural log of the number by the natural log of the base: log₂(10) = ln 10 ÷ ln 2 ≈ 3.3219. Choose “Other base” to have the calculator do it.
Why can’t I take the log of a negative number?
A positive base raised to any real power is positive, so no exponent produces zero or a negative number. The log is undefined there.
What is the log of 1?
0 in every base, because any base raised to the power 0 equals 1.
What is an antilog?
The inverse of a logarithm: the base raised to the log value. The base-10 antilog of 3 is 10³ = 1,000.
What is log base 2 used for?
Counting doublings and halvings, such as the number of bits needed to represent a number or how many times a quantity has doubled. log₂(1,024) = 10.