Logarithm Calculator
Calculate logarithms with any base. Get log base 10, natural log (ln), log base 2, and custom base logarithms instantly.
Given a value x and a base b, this calculator returns log base b of x — the exponent b must be raised to in order to equal x — expressed as ln(x) divided by ln(b), the standard change-of-base identity. Alongside the custom-base answer it always computes the natural log (base e), log base 10, and log base 2 of the same value, and those three readouts genuinely do not care what you enter for base: they run straight off x using JavaScript's own Math.log, Math.log10, and Math.log2, never routed through the base field at all. Of the two inputs, base has noticeably more pull on the custom-base result than value does — nudging base by ten percent swings the answer by close to twice the proportional amount that the same ten percent nudge to value does — and the two move the result in opposite directions: raising the base shrinks the exponent needed to reach the same x, so the result falls, while raising the value itself requires a larger exponent to reach it, so the result climbs. There is no dominant single-input relationship for the fixed-base readouts, since they only ever respond to one field, value, and never to base. Left unaddressed here: the calculator has no defined answer for a non-positive value, a non-positive base, or a base of exactly 1, since log base 1 is undefined — every power of 1 equals 1, so no exponent reaches any other number — and in each of those cases the custom-base result silently falls back to zero rather than flagging the input as invalid.
Inputs
Results
log_b(x)
2
How to Use This Calculator
- Enter the value you want to take the logarithm of in the Value field; it must be a positive number.
- Set the Base (default 10 for common log, or enter 'e' equivalent ≈ 2.718 for natural log, or 2 for binary log).
- The result is the exponent to which the base must be raised to equal the value: log_b(x) = y means b^y = x.
- Log base 10 is used in scientific notation and decibels; natural log (ln) appears in growth models and calculus.
- Log base 2 is fundamental in information theory and computer science (bits of entropy).
- Value must be strictly greater than 0 and base must be positive and not equal to 1.
How the result changes with Base (b)
| Base (b) | log_b(x) |
|---|---|
| 1,000 | 0.666667 |
| 3,500 | 0.564323 |
| 6,500 | 0.524533 |
| 9,000 | 0.505786 |
What each input means
- Value (x)
- The input value.
- Base (b)
- The base of the logarithm. Common: 10, e (2.718), 2.
How this is calculated
Worked example, using the default values
- Identify Input ParametersValue (x) = 100, Base (b) = 10 = 2 input(s) provided
- Calculate log_blog_b2 = 2
- Calculate ln(x) — Natural Logln(x) — Natural Log4.60517 = 4.60517
- Calculate log₁₀log₁₀2 = 2
Engine last updated . Checked against 2 independently-derived tests — how we verify calculators.
Frequently Asked Questions
Why does changing the base leave the natural log and log base 10 readouts unchanged?
Those two readouts, along with log base 2, are computed directly from your value using fixed formulas — ln(x), log base 10 of x, and log base 2 of x — that never reference the base field you typed into at all. Only the top result, labeled log_b(x), actually depends on the base you choose; the other three exist purely as fixed reference conversions.
Why does raising the base lower the answer, while raising the value raises it?
These are opposite relationships built into what a logarithm means. A larger base reaches the same target value with a smaller exponent, so log_b(x) falls as b grows. A larger value, on the other hand, needs a bigger exponent to reach from the same base, so log_b(x) rises as x grows. Both effects are visible if you nudge one field at a time and watch the top result move.
What happens if I enter a base of 1?
The calculator treats it as an invalid base and returns zero for the custom result rather than a real answer, because logarithm base 1 has no meaningful definition — every power of 1 equals 1, so there is no exponent that could turn 1 into any value other than 1, and the formula has no way to solve for one.
Can I compute the logarithm of a negative number or zero?
No. The value field requires a positive number because logarithms of zero or negative numbers are undefined in the real number system — there is no real exponent that raises a positive base to a negative result or to zero. Entering zero or a negative value returns zero from every readout instead of a meaningful logarithm.
Related Calculators
The questions that sit next to this one — chosen by subject, including calculators filed under a different category.
Quadratic Equation Solver
Solve quadratic equations (ax² + bx + c = 0). Find roots, discriminant, vertex, and axis of symmetry with a visual graph.
Math & StatisticsFraction Calculator
Add, subtract, multiply, or divide fractions. Get simplified results, mixed numbers, and decimal equivalents.
Math & StatisticsPercentage Calculator
Calculate percentages easily — find a percentage of a number, percentage increase/decrease, and percentage change between two values.
More in Math & Statistics.