Intermediate

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.
The number to take the logarithm of (must be > 0)
The logarithm base (must be > 0 and ≠ 1)
log_b(x)
3

log base 2 of 8

ln(x)
2.079442
ln(b)
0.693147
log₁₀(x)
0.90309
log₁₀(b)
0.30103
Change-of-base steps
1

Apply the change-of-base formula

log_b(x) = ln(x) / ln(b)
2

Substitute values

log_2(8) = 2.079442 / 0.693147
=

Result

= 3
(8, 3)
Step by step
  1. 1

    Natural log of the argument: ln(x)

    ln(8) = 2.079442
  2. 2

    Natural log of the base: ln(b)

    ln(2) = 0.693147
  3. 3

    log_b(x) = ln(x) ÷ ln(b)

    2.079442 ÷ 0.693147 = 3
Results are estimates for general information only and are not professional advice — always verify important results independently before relying on them. Read the full disclaimer.
Quick answer

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
log_b(x) = ln(x) / ln(b) = log₁₀(x) / log₁₀(b) (x > 0, b > 0, b ≠ 1)
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.

APA

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

Chicago

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.

IEEE

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

BibTeX

@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?