Raise a number to a power, keeping integer and simple fractional exponents exact - 8^(2/3) is reported as exactly 4.
Logarithm Calculator
Compute a logarithm in any base, reporting an exact whole number when there is one - log10(1000) is exactly 3.
- Free
- No sign-up
- Runs in your browser
Input
Must be greater than zero.
Leave as 10 for a common logarithm. Any positive base except 1.
How many digits to show when the answer is irrational. An exact answer ignores this.
Banker’s rounding; the IEEE default
Try an example
Ready
Everything happens on this device. No upload, no account, no network request.
How to use this tool
- 1
Enter the number and the base.
- 2
When the answer is a whole number it is reported exactly, rather than as 2.9999999999999996.
Questions about Logarithm Calculator
Why does log10(1000) come out as exactly 3?
Because the tool checks whether the base raised to an integer power equals the input before computing anything. It does here, so the answer is exact. Computing it as ln(1000)/ln(10) in floating point gives 2.9999999999999996, which is the result most calculators show.
Why can the base not be 1?
Because 1 raised to any power is 1, so it can never reach another value - there is no exponent that turns 1 into 5. The logarithm base 1 is undefined for every input except 1 itself.
What does log mean without a base?
It depends on the field, which is why this tool makes it explicit. In most calculators and in engineering, log means base 10. In mathematics and in most programming languages it means the natural logarithm. In computer science it often means base 2.
Why is the logarithm of zero or a negative undefined?
Raising a positive base to any real power always gives a positive result, so no exponent produces zero or a negative. As the input approaches zero the logarithm falls without bound, so there is no value at zero either.
Is my data sent anywhere?
No. This runs as JavaScript in your browser tab: there is no network request carrying your numbers, nothing reaches a server log, and it keeps working with your connection off. You can confirm it in the browser’s network panel.
Related tools
Other tools you might reach for next.
Find a square root, reported exactly for a perfect square and to a stated precision otherwise.
Find a cube root, including of negative numbers, reported exactly for a perfect cube.
Find any integer root of a number, reported exactly when the number is a perfect power of that index.
Compute a natural logarithm to a stated precision, with ln(1) reported as exactly 0.
Evaluate an expression with exact fraction arithmetic, trigonometry, logarithms and factorials, reporting whether the result is exact.
Reduce a fraction to lowest terms, with its mixed number and exact decimal form including any repeating block.
Add two fractions exactly, showing the common denominator step and reducing the result.