Logarithm Calculator
Calculate log values with base 10, natural log (ln), or any custom base.
What Is the Logarithm Calculator?
A logarithm answers the question: to what power must the base be raised to produce a given number? This calculator computes logarithms with any base, plus quick shortcuts for base-10 (log₁₀) and natural log (ln). Logarithms are the inverse operation of exponentiation, in the same way subtraction is the inverse of addition — where 10² = 100 tells you what you get by raising 10 to the power 2, log₁₀(100) = 2 asks the reverse question and tells you which power to use.
The concept dates back to the early 1600s, when John Napier introduced logarithms specifically to turn slow, error-prone multiplication and division into faster addition and subtraction — a trick that powered manual scientific and engineering calculation for over 300 years, right up until electronic calculators became common. That compression property is also why logarithmic scales are still used today anywhere a quantity spans many orders of magnitude, like earthquake magnitude, sound intensity, or acidity.
For a full scientific calculator with logarithm functions built in alongside trigonometry and exponents, see the Scientific Calculator. Logarithms also show up when solving for time in exponential growth — the Compound Interest Calculator relies on the same natural-log relationship to work out how long an investment takes to reach a target value.
Logarithm Calculator Formula
log_b(x) = ln(x) / ln(b)
How Is the Logarithm Calculator Calculated?
Most calculators, including this one, don't have a built-in function for every possible base, so the "change of base" formula converts any log_b(x) into a ratio of natural logs, which can always be computed directly. The formula works because ln(x) = log_b(x) × ln(b) — dividing both sides by ln(b) isolates log_b(x), regardless of what base b actually is.
This is also why the three logarithm "families" you'll commonly see — base 10 (log), base e (ln), and base 2 (used heavily in computer science) — are really just scaled versions of one another. Converting between them is always a matter of dividing by the appropriate ln(base), which is exactly what happens behind the scenes whenever you enter a custom base here.
Logarithm Calculator Example
log10(100) = 2, since 10² = 100.
log2(32) = 5, since 2⁵ = 32 — this is the kind of calculation used when figuring out how many bits are needed to represent 32 distinct values.
ln(e) = 1, since raising e to the power 1 simply gives e back — the natural log of the base itself is always 1, no matter which base you're using.
How to Use the Logarithm Calculator
Step 1
Enter the number you want the logarithm of.
Step 2
Enter the base (defaults to 10), or use the log₁₀ / ln quick buttons.
Step 3
View the calculated logarithm value.
Step 4
For a negative or zero result check, confirm your number is greater than 0 and your base is greater than 0 and not equal to 1.
Step 5
Use the log₁₀ shortcut for scale-based problems like pH or decibels without retyping the base each time.
Step 6
Cross-check a whole-number result by mentally verifying base^result equals your original number.
Benefits
- Supports any positive base, not just 10 or e.
- One-click shortcuts for the two most common logarithm types.
- Precise results to 6 decimal places.
- Applies the change-of-base formula automatically, so you never need to look it up.
- Flags invalid inputs (zero, negative numbers, or a base of 1) instead of returning a misleading result.
- Fast enough to use as a mental-math double-check during a test or while working through a proof.
Common Logarithm Calculator Scenarios
Scenario 1
Solving exponential growth or decay problems.
Scenario 2
Computing pH, decibel, or Richter scale values, which are all logarithmic.
Scenario 3
Homework or coursework involving logarithmic equations.
Scenario 4
Estimating how many bits or digits are needed to represent a given quantity (using base 2 or base 10).
Scenario 5
Working out how long compound growth takes to reach a target multiple, as in the Rule of 72.
Scenario 6
Converting between different logarithm bases for a formula that expects one specific base.
Understanding Your Result
The result is the exponent that the base must be raised to in order to produce your entered number. For example, a result of 2 with base 10 means 10² equals your input number.
The sign and size of the result tell you something about your input relative to the base: a result greater than 1 means your number is larger than the base itself, a result between 0 and 1 means your number is between 1 and the base, and a negative result means your number is a fraction between 0 and 1. A result of exactly 0 always means your input number was 1, regardless of which base you used.
Tips
- Use log₁₀ for scales like pH or decibels, which are conventionally base-10.
- Use ln for natural growth/decay problems, like compound interest or radioactive decay.
- A logarithm of a number between 0 and 1 is always negative.
- Use log base 2 for anything involving repeated halving or doubling, like binary search steps or bit counts.
- If a result looks suspiciously close to a whole number, check whether your input was intended to be an exact power of the base.
Common Mistakes
- Trying to take the logarithm of zero or a negative number, which is undefined.
- Using a base of 1, which is invalid since 1 raised to any power is always 1.
- Confusing log (commonly base 10) with ln (base e) when following a formula.
- Forgetting that logarithms of numbers less than 1 are negative, not zero or undefined.
- Mixing up the roles of the "number" and "base" fields, which produces an entirely different (and usually non-integer) result.
Frequently Asked Questions
Why must the number be positive?
Logarithms are only defined for positive real numbers — the logarithm of zero or a negative number is undefined in real-number math.
What's the difference between log and ln?
log (without a specified base) usually refers to base-10, while ln refers to the natural logarithm, which uses base e (≈2.71828).
Why can't the base be 1?
Raising 1 to any power always gives 1, so a base of 1 cannot produce any other number, making the logarithm undefined.
What does a negative logarithm result mean?
It means your input number is between 0 and 1 — for example, log₁₀(0.01) = -2, since 10⁻² = 0.01.
How are logarithms used in real life?
Logarithmic scales are used for measuring earthquake magnitude (Richter scale), sound intensity (decibels), and acidity (pH), among other applications.
What is log base 2 used for?
Log base 2 is commonly used in computer science to represent binary relationships, such as how many times a quantity can be halved or how many bits are needed to represent a number of values.
Why is the natural log (ln) called 'natural'?
It uses the mathematical constant e (approximately 2.718) as its base, which arises naturally in calculus, continuous growth, and compound interest — hence the name.
Can the base of a logarithm be a fraction?
Yes, as long as the base is positive and not equal to 1 — the mathematical rules for logarithms work the same way regardless of whether the base is a whole number or a fraction.
What is the logarithm of 1?
The logarithm of 1 is always 0, regardless of the base, since any base raised to the power of 0 equals 1.
Can I share my logarithm result as an image?
Yes — tap Share and, on supported devices, your result is shared as a branded image card, not just a text link.
Who invented logarithms, and why?
John Napier introduced logarithms in the early 1600s to turn slow, error-prone multiplication and division into simpler addition and subtraction — a technique that sped up manual calculation for centuries before electronic calculators existed.
What is the change of base formula, and why does this calculator need it?
The change of base formula, log_b(x) = ln(x) / ln(b), lets any logarithm be computed using only natural logs — since it's impractical to build in a separate calculation method for every possible base, this calculator always converts through this formula.
Why is log base 2 important in computer science?
Because binary computing is built on powers of 2, log base 2 tells you how many bits are needed to represent a given number of values, or how many times a quantity can be halved — for example, log₂(32) = 5.
What does it mean if the number and result are the same, like log(10) with base 10?
It means the result is 1 — the logarithm of a number equal to the base is always 1, since the base raised to the power 1 simply equals itself.
References
Important Information
Results are rounded to 6 decimal places.
Last updated: July 25, 2026