Change of Base Calculator — Logarithm in Any Base
Calculate the logarithm of any positive number in any positive base (other than 1). Enter the argument x and the base b to apply the change-of-base formula and get log_b(x) using natural logarithms, with a plotted curve of the function.
log base 2 of 8
Apply the change-of-base formula
Substitute values
Result
- 1
Natural log of the argument: ln(x)
ln(8) = 2.079442 - 2
Natural log of the base: ln(b)
ln(2) = 0.693147 - 3
log_b(x) = ln(x) ÷ ln(b)
2.079442 ÷ 0.693147 = 3
How does this calculator work?
log_b(x) = ln(x) / ln(b). To evaluate a logarithm in any base b, divide the natural log of the argument by the natural log of the base. For example, log₂(8) = ln(8)/ln(2) = 2.0794/0.6931 = 3. The formula extends to log₁₀ or any other intermediate base equally well.
Formula
How this is calculated
Most calculators and programming languages only provide natural logarithm (ln, base e) and common logarithm (log₁₀, base 10) as built-in functions. The change-of-base formula converts any logarithm to these known bases: log_b(x) = ln(x) / ln(b). It works because ln(b) = log_b(b) / log_b(e)... which simplifies through the fundamental identity log_a(x) = log_b(x) / log_b(a). Any convenient intermediate base c gives the same result: log_b(x) = log_c(x) / log_c(b).
The formula is most useful in algebra, pre-calculus, and information theory where logarithms in non-standard bases appear. For instance, log₂ is essential in computer science (bit-counting, entropy), log₃ arises in some number-theory problems, and log₅ or log₆ appear in certain scientific models. Without the change-of-base formula you would need a separate table or function for each base.
The curve plotted below shows y = log_b(x) across the positive x-axis. When b > 1 the function is increasing and passes through (1, 0) and (b, 1). When 0 < b < 1 the function is decreasing. The shape is logarithmic growth or decay depending on the base. The specific input point (x, log_b(x)) is highlighted on the curve.
Frequently asked questions
Because logarithms in any base are proportional to each other: log_b(x) = (1/log_b(c)) × log_c(x) for any valid c. Dividing log_c(x) by log_c(b) cancels the common base c, leaving log_b(x). Natural log and log₁₀ are the conventional choices because they are directly available on calculators.
log_b(1) = 0 for every valid base b, because b⁰ = 1 by definition. The change-of-base formula confirms this: ln(1) = 0, so 0 / ln(b) = 0.
A base between 0 and 1 is valid (e.g. log₀.₅ gives the negative of log₂). The formula still works — ln(b) will be negative, and log_b(x) > 0 when x < 1 and < 0 when x > 1, which is the mirror image of the standard logarithm. Such bases are rare in practice.
TG we-Calculate Editorial Team. (2026). Change of Base Calculator — Logarithm in Any Base [Online calculator]. TG we-Calculate. https://we-calculate.com/calculator/change-of-base-calculator
TG we-Calculate Editorial Team. "Change of Base Calculator — Logarithm in Any Base." TG we-Calculate. 2026. https://we-calculate.com/calculator/change-of-base-calculator.
TG we-Calculate Editorial Team, "Change of Base Calculator — Logarithm in Any Base," TG we-Calculate, 2026. [Online]. Available: https://we-calculate.com/calculator/change-of-base-calculator
@misc{wecalculate_change_of_base_calculator, title = {Change of Base Calculator — Logarithm in Any Base}, author = {{TG we-Calculate Editorial Team}}, howpublished = {\url{https://we-calculate.com/calculator/change-of-base-calculator}}, year = {2026}, note = {TG we-Calculate} }
Did this calculator help you?
