How do you calculate a logarithm in any base?
Find log_b(x) or the power b^y in any base, with ln, log₁₀ and log₂.
What you enter stays on your device while you use this tool. Opening a shared link sends the settings in its address to HowToolbox to prepare the page.
log₂(8)
3
log₂(8) = 3 because 2³ = 8.
Key values as a table
| x | log₂(x) |
|---|---|
| 1 | 0 |
| 2 | 1 |
| 4 | 2 |
| 8 | 3 |
- ln x
- 2.07944
- log₁₀ x
- 0.90309
- log₂ x
- 3
Formula
Change of base: log₂(8) = ln 8 / ln 2 = 2.07944 / 0.693147 = 3
Find log_b(x) or the power b^y in any base, with ln, log₁₀ and log₂.
How to use
- Choose what to find: the logarithm (the exponent) or the power (the number).
- Pick the base: 10, e, 2 or any other, and type the number or the exponent.
- Read the answer with the change of base and the logarithms in bases e, 10 and 2. Drag the point along the curve to try other values.
Logarithms of common numbers
How it works
A logarithm answers the question: to what power must I raise the base to get this number? Since 10³ = 1000, log₁₀(1000) = 3, and since 2⁵ = 32, log₂(32) = 5. So y = log_b(x) and b^y = x say the same thing, and this tool works in both directions.
Calculators usually only know ln (base e ≈ 2.71828) and log (base 10). Any other base comes from the change-of-base rule log_b(x) = ln(x) / ln(b). For log₃(81): ln 81 / ln 3 = 4.39445 / 1.09861 = 4, because 3⁴ = 81. The curve always passes through (1, 0) and (b, 1), climbs ever more slowly for bases above 1, and never reaches x = 0.
Logarithms exist only for positive numbers and bases other than 1. Results are rounded to six significant digits. Sources: OpenStax College Algebra 2e, sections 6.3 and 6.5.
Sources
- OpenStax College Algebra 2e, §6.3 Logarithmic FunctionsUsed for: definitions
- OpenStax College Algebra 2e, §6.5 Logarithmic PropertiesUsed for: formula
Frequently asked questions
What is the difference between log and ln?
ln means base e, while log often means base 10. Some subjects use log for other bases, so check the convention and select the intended base.
How do I solve 2^x = 50?
Choose Logarithm, base 2 and number 50. The result is x ≈ 5.64386.
Why can a logarithm be negative?
For a base greater than 1, numbers between 0 and 1 have negative logarithms. A negative exponent gives the reciprocal of a positive power.
Can I use a base between 0 and 1?
Yes. Choose a custom base; the logarithm then decreases as the input increases.
Is log(x + y) equal to log(x) + log(y)?
No. The sum of logarithms equals the logarithm of a product, log(xy), for positive x and y in the same base.
Next you might need
More in Math & numbers
- Percentage calculator, private, runs on your device
- Area of shapes, private, runs on your device
- Circle calculator, private, runs on your device
- Combinations and permutations calculator, private, runs on your device
- Complex number calculator, private, runs on your device
- Confidence interval calculator, private, runs on your device





