Logarithm Calculator
The curve shows y = log base b of x. Move the slider to see how the point changes.
Logarithm in base b:
Natural logarithm, ln(x):
Base 10 logarithm, log(x):
Base 2 logarithm:
Exponential form:
Calculation:
Enter a number and a base, and the calculator gives you the logarithm, the natural log, the base 10 and base 2 logs, and the change of base step by step. On the right you see the graph of y = log base b of x with your point marked: if you change the number or the base, the point and the curve move instantly.
Below you will find the definition, the formulas, worked examples, a table and the most common questions.
How to use the logarithm calculator
Step 1: Enter the number x or move the slider, which runs from 0.001 to 1000. It must be greater than 0.
Step 2: Enter the base b, or tap 2, e, 10 or 0.5. You can type the letter e. The base must be greater than 0 and not equal to 1.
Step 3: Click Calculate or press Enter. The results also update as you type.
Step 4: Read the logarithm, its exponential form and, in the Calculation box, the change of base with your numbers. The orange point on the graph is (x, y).
Logarithm definition and formulas
The base b logarithm of x is the exponent you must raise b to in order to get x:
| logb(x) = y ⇔ by = x |
To compute it in any base, use the change of base rule with natural logs (ln) or base 10 logs:
| logb(x) = ln(x) ÷ ln(b) = log(x) ÷ log(b) |
Two values worth remembering: logb(1) = 0 and logb(b) = 1 for every base. The number x must be positive, and the base must be positive and not 1. The natural log ln is the base e log, where e ≈ 2.71828, and log with no base usually means base 10.
Logarithm examples
Example 1: log base 2 of 8
log2(8) = y ⇔ 2y = 8
23 = 8, so 3
Asking for the logarithm is asking for the exponent: how many times do I multiply 2 by itself to reach 8?
Example 2: log base 10 of 0.01
log10(0.01) = y ⇔ 10y = 0.01
10-2 = 0.01, so -2
The result is negative because x is less than 1: the curve sits below the x-axis.
Example 3: log base 5 of 20 with change of base
log5(20) = y ⇔ 5y = 20
log5(20) = ln(20) ÷ ln(5) = 2.995732 ÷ 1.609438 ≈ 1.861
It is not a whole number, because 20 is not a power of 5. It lies between 51 = 5 and 52 = 25.
Example 4: log base 9 of 3
log9(3) = y ⇔ 9y = 3
log9(3) = ln(3) ÷ ln(9) = 1.098612 ÷ 2.197225 = 0.5
The result is 1/2 = 0.5: 91/2 = √9 = 3. The calculator shows the fraction when the result is exact.
Common logarithms table
| x | ln(x) | log(x) base 10 | log base 2 |
|---|---|---|---|
| 1 | 0 | 0 | 0 |
| 2 | 0.6931 | 0.301 | 1 |
| 3 | 1.099 | 0.4771 | 1.585 |
| 5 | 1.609 | 0.699 | 2.322 |
| 10 | 2.303 | 1 | 3.322 |
| 20 | 2.996 | 1.301 | 4.322 |
| 50 | 3.912 | 1.699 | 5.644 |
| 100 | 4.605 | 2 | 6.644 |
Frequently asked questions
Can you take the logarithm of a negative number or of zero?
Not with real numbers. Since b raised to any exponent gives a positive result, no y can give 0 or a negative number. That is why x must be greater than 0, and the graph gets closer to the y-axis without touching it (the asymptote x = 0).
What is the difference between log and ln?
log is the base 10 logarithm and ln is the natural logarithm, with base e (about 2.71828). For example, log(100) = 2 and ln(100) = 4.605.
How do I calculate a base 2 or other base logarithm if my calculator only has log and ln?
Use the change of base rule: divide the log of x by the log of the base. For log base 5 of 20: ln(20) ÷ ln(5) = 2.996 ÷ 1.609 = 1.861.
Why can the base not be 1?
Because 1 raised to any exponent is always 1, so you could never reach any other number. Bases of 0 or less do not work either.
What happens if the base is less than 1?
The function is decreasing: as x grows, the logarithm goes down. For example, log base 0.5 of 8 is -3, because 0.5-3 = 8. Try base 0.5 and watch the curve flip.
Learn more
- Laws of logarithms
- Change of base of logarithms
- Properties of natural logarithms
- Graphs of logarithmic functions
- How to solve logarithmic equations
Related calculators
- Function Graphing Calculator
- Exponential Equations Calculator
- Derivatives Calculator
- Scientific Notation Calculator
You can explore other calculators here.