A little context. A clearer answer.
When this calculator is useful
Calculate a logarithm in any valid positive base, plus natural, decimal and binary logarithms. Enter your values and inspect the calculation details. For a related calculation, try Exact integer power calculator.
What to enter
| Input | What it means | Example value |
|---|---|---|
| Positive argument x | Positive argument. Decimal and scientific notation are accepted. | 8 |
| Logarithm base | Positive base other than 1. Bases below 1 are valid. | 2 |
How the calculation works
- Validate x > 0, b > 0 and b ≠ 1.
- Use log_b(x) = ln(x)/ln(b), with log1p near 1 for numerical stability.
- Also calculate ln(x), log₁₀(x) and log₂(x); the plot uses a logarithmic horizontal axis.
log_b(x) = ln(x)/ln(b); x > 0; b > 0; b ≠ 1A worked example
Worked example: x = 8 and b = 2 gives log₂(8) = 3, ln(8) ≈ 2.079442 and log₁₀(8) ≈ 0.90309.
Example you can load
What to enterThis is a fixed example; changing the form above does not change these numbers.
Assumptions & limits
Both argument and base must be between 1e−100 and 1e100; the base cannot equal 1. Results use floating-point arithmetic. Values indistinguishable from 1 at machine precision are treated as 1.
Frequently asked questions
Can the base be below 1?
Yes. For 0 < b < 1 the logarithm decreases as the argument increases.
Why is base 1 invalid?
Every power of 1 is 1, so it cannot define a unique inverse logarithm.
Can I enter a negative argument?
No. This tool calculates real logarithms of positive numbers only.