Free Online Log Calculator
Enter a positive number and a valid base to calculate logarithms instantly.
Rules: x > 0, b > 0, and b ≠ 1.
What this online log calculator does
This tool calculates three values in one click: the logarithm of x in your chosen base b, the natural logarithm ln(x), and the common logarithm log10(x). It is useful for algebra, statistics, data science, finance, and exam prep.
Instead of manually using change-of-base every time, you can enter your number once and get clean, formatted results. The calculator also validates inputs so you avoid undefined results.
How to use it
- Enter the number you want to evaluate in the Number (x) field.
- Enter the logarithm base in the Base (b) field.
- Choose how many decimal places you want.
- Click Calculate.
If you enter invalid values (such as a negative number or base 1), the tool will explain exactly what to fix.
Logarithm basics (quick refresher)
A logarithm answers this question: “To what exponent must I raise base b to get x?”
In equation form:
logb(x) = y means by = x.
Common types of logs
- Natural log: ln(x) = loge(x), where e ≈ 2.71828
- Common log: log(x) usually means log10(x)
- Binary log: log2(x), common in computer science
Examples
Example 1: log2(64)
Because 26 = 64, the answer is 6.
Example 2: log10(1000)
Because 103 = 1000, the answer is 3.
Example 3: ln(20)
The value is approximately 2.995732. This appears often in growth and decay models.
Where logarithms are used in real life
- Finance: compound growth and continuously compounded returns
- Science: pH scale, sound intensity (decibels), earthquake magnitude
- Machine learning: log loss, entropy, and likelihood functions
- Engineering: Bode plots and signal analysis
- Statistics: normalizing skewed data with log transforms
Important input rules
- The number x must be greater than zero.
- The base b must be greater than zero.
- The base b cannot equal 1, because that makes the logarithm undefined.
FAQ
Why can’t I take the log of 0 or a negative number?
For real-number logarithms, the domain is strictly positive numbers. So x must be > 0.
What if I need more precision?
Increase the decimal places up to 15. For very large or tiny outputs, scientific notation may be shown.
How is logb(x) calculated?
This calculator uses the change-of-base identity: logb(x) = ln(x) / ln(b).