# Logarithm Calculator

URL: https://hifreetools.com/calculators/logarithm-calculator

> Enter a value x and a base b and this calculator returns log_b(x) using the change-of-base formula ln(x) ÷ ln(b), alongside the natural log (ln x) and common log (log₁₀ x). It handles any positive base except 1 and flags x ≤ 0, since the real logarithm is undefined there.

## Quick answer

A logarithm log_b(x) is the exponent you must raise the base b to in order to get x, and it is computed with the change-of-base formula log_b(x) = ln(x) ÷ ln(b). For example, log₁₀(1000) = ln(1000) ÷ ln(10) = 6.90776 ÷ 2.30259 = 3, because 10³ = 1000. This calculator evaluates log_b(x) for any base b > 0 (b ≠ 1) and also reports ln(x) and log₁₀(x) for the same value.

## Formula

- log_b(x) = ln(x) ÷ ln(b)
- log_b(x) = y ⟺ bʸ = x

## Inputs

- Value x (x > 0) (0 to 1e+300); default 1000
- Base b (b > 0, b ≠ 1) (0 to 1e+300); default 10

## Worked examples (computed by the page's own function)

- Value x (x > 0) = 1000, Base b (b > 0, b ≠ 1) = 10 → log_b(x) = 3, Natural log — ln(x) = 6.907755, Common log — log₁₀(x) = 3  (log_10(1000) = ln(1000) ÷ ln(10) = 6.9077553 ÷ 2.3025851 = 3)
- Value x (x > 0) = 64, Base b (b > 0, b ≠ 1) = 2 → log_b(x) = 6, Natural log — ln(x) = 4.158883, Common log — log₁₀(x) = 1.80618  (log_2(64) = ln(64) ÷ ln(2) = 4.1588831 ÷ 0.69314718 = 6)
- Value x (x > 0) = 0.2, Base b (b > 0, b ≠ 1) = 5 → log_b(x) = -1, Natural log — ln(x) = -1.609438, Common log — log₁₀(x) = -0.69897  (log_5(0.2) = ln(0.2) ÷ ln(5) = -1.6094379 ÷ 1.6094379 = -1)

## Verification

Checked against 17 reference cases (expected values computed independently). Reviewed 2026-10-27. Latest change 2026-10-28: Moved to the schema renderer with a sourced ledger; results keep 6 decimals instead of 6 significant figures and the change-of-base check is the receipt line.

## FAQ

**What is the difference between log, ln, and log₁₀?**
“log₁₀” (often written just “log”) is the common logarithm, base 10. “ln” is the natural logarithm, base e ≈ 2.71828. “log_b” is the general logarithm to a base b you choose. They differ only by a constant factor: ln(x) = log₁₀(x) × ln(10) ≈ log₁₀(x) × 2.3026. This calculator shows log_b(x) for your chosen base plus ln(x) and log₁₀(x) for the same x.

**How does the change-of-base formula work?**
log_b(x) = ln(x) ÷ ln(b). Any common base works in place of ln, including log₁₀, because the base you pick cancels in the ratio. This is how a calculator computes a base it has no dedicated key for — for log₅(0.2) it divides ln(0.2) by ln(5) to get −1.

**Why can't I take the logarithm of a negative number or zero?**
A logarithm asks “to what power must I raise the base to get x?” Since a positive base raised to any real power is always positive, no real exponent can produce 0 or a negative result. log(0) heads to −∞, and log(−4) only exists in the complex numbers, so the real-valued calculator rejects x ≤ 0.

**Why must the base be greater than 0 and not equal to 1?**
A negative or zero base does not give a consistent, single-valued logarithm. Base 1 is excluded because 1 raised to any power is 1, so log₁(x) cannot identify a unique exponent — in the formula it would mean dividing by ln(1) = 0, which is undefined.

**What are log of 1 and log of the base itself?**
log_b(1) = 0 for every valid base, because any nonzero base to the power 0 equals 1. And log_b(b) = 1, because b¹ = b. These two identities are handy checkpoints: if your answer for log₁₀(1) isn’t 0 or log₂(2) isn’t 1, something is off.

**Is the answer rounded?**
Displayed values are rounded to about 6 significant figures for readability, so an irrational result like log₁₀(50) shows as 1.69897. Clean results such as log₂(64) = 6 or log₁₀(1000) = 3 are shown exactly, because the calculator uses the precise native log for bases 2, e, and 10 to avoid floating-point drift.


## Sources

- [Wikipedia — Logarithm (change of base)](https://en.wikipedia.org/wiki/Logarithm)
- [NIST Digital Library of Mathematical Functions — §4.2 Logarithm](https://dlmf.nist.gov/4.2)
- [Wolfram MathWorld — Logarithm](https://mathworld.wolfram.com/Logarithm.html)

Runs in the browser; nothing is uploaded. Cite as: HIFreeTools, "Logarithm Calculator", https://hifreetools.com/calculators/logarithm-calculator
