# Free online logarithm calculator

> A logarithm answers the question "what exponent produces this number?" — log_b(x) = y means b^y = x. This calculator computes log in any base and always shows ln, log₁₀, and log₂.

Calculate log base 2, natural log (ln), log base 10, or any custom base logarithm. Uses the change-of-base formula and shows the expression, result, and all three common log values simultaneously.

**Interactive version:** https://onlinecalculator.me/math/logarithm/
**Category:** Math

## How to use

1. Enter a positive value (x).
2. Select a base — 2, e (natural log), 10, or Custom.
3. For a custom base, enter any positive number other than 1.
4. The result and expression appear instantly.

## The formula

```
log_b(x) = ln(x) / ln(b)     ← change-of-base formula
```

Where ln is the natural logarithm. Special cases:

- **log₂(x):** used in computer science and information theory
- **ln(x):** base e, used in calculus and natural growth models
- **log₁₀(x):** common log, used in pH, decibels, and the Richter scale

Source: Abramowitz M, Stegun IA. *Handbook of Mathematical Functions.* 1964. §4.1

## Worked examples

**log₂(8) = 3** — because 2³ = 8

**log₁₀(1000) = 3** — because 10³ = 1000

**ln(e) = 1** — because e¹ = e

**log₃(27) = 3** — because 3³ = 27

**log₅(25) = 2** — because 5² = 25

## Notes

- log_b(1) = 0 for any base b (because b⁰ = 1).
- log_b(b) = 1 for any base b (because b¹ = b).
- Logarithms of values between 0 and 1 are negative.
- This calculator shows results to 9 significant figures.

## Frequently asked questions

### What is a logarithm?

A logarithm is the inverse of exponentiation. log_b(x) = y means b^y = x. For example, log₂(8) = 3 because 2³ = 8.

### What is the natural logarithm (ln)?

The natural logarithm uses base e ≈ 2.71828. It appears in calculus, growth models, and compound interest. ln(e) = 1 and ln(1) = 0.

### How is the change-of-base formula used?

log_b(x) = ln(x) / ln(b). This lets any logarithm be computed using natural log. For example, log₂(8) = ln(8) / ln(2) = 2.0794 / 0.6931 = 3.

### What inputs are invalid?

The value must be positive (x > 0). The base must be positive and not equal to 1. Logarithms of zero or negative numbers are not real numbers.

### Can I use a custom base?

Yes. Select "Custom base" from the drop-down and enter any positive number other than 1.

## Sources

- [Logarithm](https://en.wikipedia.org/wiki/Logarithm) — Wikipedia
- [Logarithm](https://mathworld.wolfram.com/Logarithm.html) — Wolfram MathWorld

## Related calculators

- [Exponent calculator](https://onlinecalculator.me/math/exponent/) — Compute b^e for any base and exponent, including fractional and negative powers.
- [Scientific calculator](https://onlinecalculator.me/math/scientific/) — Full scientific calculator with trig, logarithms, memory, and keyboard support.
- [Square root calculator](https://onlinecalculator.me/math/square-root/) — Calculate the square root or any nth root of any real number.
- [Percentage change calculator](https://onlinecalculator.me/math/percentage-change/) — Percentage increase or decrease between any two values.

---

Part of [onlinecalculator.me](https://onlinecalculator.me/) — free calculators that run entirely in your browser.
Machine-readable index: https://onlinecalculator.me/llms.txt
