Logarithm Calculator
Calculate a logarithm with base 10, base 2, base e, or any valid custom base. The result includes the equivalent exponential form and calculation steps.
Exponential form: 10³ = 1000
- Use the change-of-base formula: log₁₀(1000) = ln(1000) / ln(10).
- ln(1000) ≈ 6.907755 and ln(10) ≈ 2.302585.
- 6.907755 / 2.302585 = 3.
What the Logarithm Result Means
A logarithm answers an exponent question. If logb(x) = y, then by = x. For example, log10(1000) = 3 because 103 = 1000.
The answer can be negative or fractional. A negative logarithm is valid when the input lies between 0 and 1 for a base greater than 1. For example, log10(0.01) = -2.
Logarithm Formula
For a positive number x and a valid base b, the logarithm is written as:
Change-of-base formula
A logarithm with almost any valid base can be calculated using natural logarithms:
The same relationship also works with common logarithms: logb(x) = log10(x) / log10(b).
Valid inputs
- x must be greater than 0. Real-valued logarithms are not defined for zero or negative inputs.
- The base must be greater than 0.
- The base cannot equal 1. Powers of 1 never produce values other than 1, so they cannot define a usable logarithm function.
- A base between 0 and 1 is allowed. For example, log0.5(0.25) = 2.
Common, Natural, and Binary Logarithms
| Type | Notation | Base | Example |
|---|---|---|---|
| Common logarithm | log(x) or log10(x) | 10 | log10(100) = 2 |
| Natural logarithm | ln(x) | e ≈ 2.71828 | ln(e) = 1 |
| Binary logarithm | log2(x) | 2 | log2(8) = 3 |
| Custom logarithm | logb(x) | Any positive base except 1 | log5(125) = 3 |
How to Use the Calculator
- Enter the positive number whose logarithm you want to find.
- Select base 10, base e, base 2, or Custom base.
- If you choose a custom base, enter a positive number other than 1.
- Select how many decimal places may be shown.
- Press Calculate Logarithm.
- Read the logarithm, equivalent exponential form, and calculation steps in the result box.
Worked Example: log₂(32)
Suppose you want to calculate log2(32). This asks: “What exponent on 2 produces 32?”
- ln(32) ≈ 3.465736
- ln(2) ≈ 0.693147
- 3.465736 / 0.693147 = 5
Therefore, log2(32) = 5. The exponential check is 25 = 32.
Where Logarithms Are Used
Logarithms are useful whenever values grow or shrink by repeated multiplication rather than simple addition.
- Algebra: solving equations in which the unknown appears in an exponent.
- Science: working with exponential growth, decay, and measurements expressed on logarithmic scales.
- Computing: base-2 logarithms help describe powers of two and repeated halving or doubling.
- Data analysis: logarithmic transformations can make very wide numerical ranges easier to compare.
- Compound growth: logarithms can isolate an unknown time or exponent in exponential formulas.
Logarithm Rules That Help With Manual Calculations
For positive values where the expressions are defined, these identities can simplify logarithmic expressions:
Two useful reference values are logb(1) = 0 and logb(b) = 1.
Common Input Mistakes
- Entering zero: a real logarithm of zero does not exist.
- Entering a negative number: this calculator works with real-valued logarithms, so the input must be positive.
- Using base 1: 1 is not a valid logarithm base.
- Confusing ln with log base 10: ln uses base e, while the common logarithm uses base 10.
- Rounding too early: keeping more digits during intermediate calculations produces a more accurate final result.
Precision and Calculator Limits
This calculator uses JavaScript floating-point arithmetic. Most everyday logarithm calculations are displayed accurately to the selected number of decimal places, but values can contain tiny rounding differences. An exact mathematical result such as 3 may internally be represented by a nearby decimal before formatting.
Inputs must also fit within the numeric range supported by the browser. The tool rejects blank entries, non-finite values, invalid bases, zero, and negative inputs.
Frequently Asked Questions
What is log base 10?
Log base 10 is the common logarithm. For example, log10(10000) = 4 because 104 = 10000.
What is the difference between log and ln?
In many math contexts, log commonly refers to base 10 while ln always means the natural logarithm with base e. The notation used can vary by field, so checking the stated base is useful.
Can a logarithm be negative?
Yes. With a base greater than 1, inputs between 0 and 1 have negative logarithms. For example, log10(0.1) = -1.
Can the logarithm base be a decimal?
Yes. A base such as 0.5 or 2.5 is valid as long as it is positive and not equal to 1.
Why is log(1) always 0?
Any valid logarithm base raised to the power 0 equals 1. Therefore, logb(1) = 0.
How do I calculate a logarithm with an unusual base?
Choose Custom base in the calculator. The calculation uses the change-of-base relation logb(x) = ln(x) / ln(b).





