Math
Logarithm Calculator
Evaluate logarithms in any base — the common log (base 10), the natural log (base e), or a custom base — using the change-of-base rule.
Calculation inputs
The value must be positive. A custom base must be positive and not equal to 1.
Results
No result yet
Complete the fields and select Calculate to show results here.
About this calculator
This tool evaluates logarithms in any base: the common log (base 10), the natural log (base e), or any custom base you choose. It shows every form of the answer at once and the change-of-base working behind it.
How the calculation works
- log_b(x) = the power you raise b to, in order to get x
- Change of base: log_b(x) = ln(x) ÷ ln(b) = log₁₀(x) ÷ log₁₀(b)
- Common log uses base 10; natural log uses base e ≈ 2.71828
Notes and assumptions
A logarithm answers the question “what exponent?”. Because 10³ = 1000, log₁₀(1000) = 3.
Logs are undefined for zero and negative numbers, and a base of 1 is not allowed because 1 to any power stays 1.
How it works in plain English
A logarithm answers a simple question: what power must I raise the base to, in order to get this number? Because 10³ = 1000, the common log of 1000 is 3. The tool computes that exponent for your value.
Most calculators and programming languages only provide two logs directly: the natural log ln(x), with base e ≈ 2.71828, and the common log log₁₀(x). Every other base is reached through the change-of-base rule: log base b of x equals ln(x) divided by ln(b).
The tool always shows ln(x) and log₁₀(x) alongside your chosen answer, so you can see the relationship. Logarithms are only defined for positive values, and a base must be positive and not equal to 1, since 1 to any power stays 1.
The formula
- log_b(x) = y means b^y = x
- Change of base: log_b(x) = ln(x) ÷ ln(b)
- ln(x) = log base e of x, where e ≈ 2.71828
Worked example
Suppose you want log base 2 of 32 — the number of times you must double 1 to reach 32.
Choose the custom base, enter 32 as the value and 2 as the base. The tool computes ln(32) ÷ ln(2), which is 3.4657 ÷ 0.6931, giving exactly 5.
That matches the direct check: 2⁵ = 32. The same screen also shows ln(32) ≈ 3.4657 and log₁₀(32) ≈ 1.5051, so you can see all three forms of the answer together.
Common logarithm values
| Expression | Value | Why |
|---|---|---|
| log₁₀(1000) | 3 | 10³ = 1000 |
| log₂(32) | 5 | 2⁵ = 32 |
| ln(e) | 1 | e¹ = e |
| log_b(1) | 0 | any base to the power 0 is 1 |
| log_b(b) | 1 | any base to the power 1 is itself |
Source: standard mathematical constants and identities, as tabulated in any algebra reference.
Frequently asked questions
What is the difference between log and ln?
Log without a base usually means base 10 (the common log), while ln means base e ≈ 2.71828 (the natural log). They differ only by a constant factor: ln(x) is about 2.3026 times log₁₀(x). In some fields, especially computer science, log means base 2, so check the convention.
Why can't I take the log of zero or a negative number?
A logarithm asks what power of the base produces your value. A positive base raised to any real power is always positive, so no exponent can produce zero or a negative result. Logs of such values are undefined in real numbers.
Why is a base of 1 not allowed?
One raised to any power is still one, so the question “what power of 1 gives me 5?” has no answer, and “what power of 1 gives me 1?” has infinitely many. A base of 1 makes the logarithm meaningless, which is why bases must be positive and not equal to 1.
What is the change-of-base formula for?
It lets you evaluate any base using the two logs every calculator has. Log base b of x equals ln(x) divided by ln(b), or equally log₁₀(x) divided by log₁₀(b). For example, log base 2 of 32 is ln(32) ÷ ln(2), which is exactly 5.
Where are logarithms used in real life?
Anywhere quantities grow or shrink by multiplication: compound interest and investment doubling times, the pH scale in chemistry, decibels in sound, the Richter scale for earthquakes, and algorithm complexity in computing. Each compares ratios rather than absolute differences.
Related tools
Trig, logs, powers, roots, factorials, and memory.
Add, subtract, multiply, and divide fractions.
Mean, variance, and standard deviation of a data set.
Discriminant and real or complex roots of a quadratic.