Free Algebra Solver
Log calculator

Log Calculator

Type log(1000) for base 10, log_2(32) or log(32, 2) for another base, or ln(10) for the natural log. You get the answer and the steps.

Preview log_2(32) (Calculate) Ready
Examples
Solution

Worked example: log_2(32)

Worked example. Edit the problem above and press Calculate to solve your own.

Problemlog_2(32)
  1. Evaluate the functions, roots, and powers

    Work out each function value first. Exact values are kept as fractions, roots, or multiples of π when they exist.

    log_2(32) = 5

    Functions and powers come before multiplication, division, addition, and subtraction in the order of operations.

  2. Combine using the order of operations

    Multiply and divide from left to right, then add and subtract.

    log_2(32)
    Original calculation
    5
    Exact value

    Every step used exact arithmetic, so the result has no rounding error.

Answer5

Logarithms guide

How to use the log calculator in any base

This log calculator finds logarithms in base 10, base e or any other base and shows the steps. Type log(1000) for base 10, log_2(32) or log(32, 2) for base 2, and ln(10) for the natural log.

What is a logarithm?

A logarithm is the exponent you need to raise a base to in order to get a number. log_b(x) = y means bʸ = x. For example, log₂(32) = 5 because 2⁵ = 32, and log(1000) = 3 because 10³ = 1000. A logarithm answers the question "what power?"

What does a logarithm mean?

A logarithm undoes an exponent. If bʸ = x, then log_b(x) = y, so the log gives you back the power.

Every log statement can be rewritten as an exponent statement, and that is the easiest way to check one. log₃(81) = 4 because 3⁴ = 81. log₂(1/8) = −3 because 2⁻³ = 1/8.

Definition
log_b(x) = y means bʸ = x
Example
log₂(32) = 5 because 2⁵ = 32

The base has to be positive and not equal to 1, and x has to be positive. Those limits come straight from the exponent form.

A base 10 log also tells you roughly how many digits a number has. log(500) ≈ 2.69897000434 and log(5000) ≈ 3.69897000434, so each extra digit adds 1 to the log. That is why log scales are used for things that span huge ranges.

What is the difference between log and ln?

log with no base written means log base 10, the common log. ln means the natural log, which uses base e ≈ 2.71828182846.

Base 10 fits our number system, so whole powers of ten give whole answers: log(100) = 2 and log(0.01) = −2. The natural log comes up in growth, decay and calculus. Use this page as a natural log calculator by typing ln( ): ln(10) ≈ 2.30258509299 and ln(1) = 0.

The two are easy to mix up on paper, and they give very different numbers. log(100) = 2, while ln(100) ≈ 4.60517018599. If a textbook writes log without a base, it almost always means base 10, though some higher-level books use log for ln.

You typeBaseExample result
log(1000)103
ln(10)e≈ 2.30258509299
log_2(32)25
log(32, 2)25

How do you calculate a log with a different base?

Use the change of base formula: divide the natural log of the number by the natural log of the base. Base 10 logs work the same way in place of ln.

Here is how a log base 2 calculator gets log₂(10), which isn't a whole number.

Change of base
log_b(x) =ln(x)ln(b)
Example
log₂(10) = ln(10) ÷ ln(2) ≈ 2.30258509299 ÷ 0.69314718056 ≈ 3.32192809489

A quick sense check: 2³ = 8 and 2⁴ = 16, so log₂(10) has to be between 3 and 4. An answer of about 3.32 fits.

What are the rules of logarithms?

The three main log rules turn multiplication into addition, division into subtraction and powers into multiplication. They are the exponent rules read backwards.

Product rule
log(ab) = log(a) + log(b), so log(2 × 50) = log 2 + log 50 = 2
Quotient rule
log(a/b) = log(a) − log(b), so log(1000) − log(10) = log(100) = 2
Power rule
log(aⁿ) = n × log(a), so log(10⁴) = 4 × log(10) = 4

The rules hold in any base, including ln. For instance, ln(4) + ln(5) = ln(20) ≈ 2.99573227355.

Why is the log of 0 or a negative number undefined?

No power of a positive base ever gives 0 or a negative number. So there is no exponent that could be the answer, and log(0) and log(−5) are undefined.

Try it with base 10: 10² = 100, 10⁰ = 1 and 10⁻² = 0.01. The results get closer to 0 but never reach it, and they never go below it. The calculator shows a domain error for these inputs instead of a number.

When is a logarithm an exact answer?

A log is exact when the number is a power of the base. log(1000) = 3 exactly, log₂(64) = 6 and log₄(2) = 1/2, because 4^(1/2) = 2.

Otherwise the answer is irrational, and the logarithm calculator shows it to 12 significant digits with the ≈ sign. log(2) ≈ 0.301029995664 and ln(10) ≈ 2.30258509299 are examples. Round only at the end of a problem so the error doesn't build up.

How do you use logs to solve exponential equations?

When the unknown is in the exponent, take the log with the same base on both sides. That brings the exponent down where you can solve for it.

  1. Start with 2ˣ = 10.
  2. Take log base 2 of both sides: x = log₂(10).
  3. Use change of base: x = ln(10) ÷ ln(2) ≈ 3.32192809489.

With base e, use ln: eˣ = 5 gives x = ln(5) ≈ 1.60943791243. This page evaluates logs, so to solve the equation itself with steps, type it into the algebra solver.

Sometimes you don't need a log at all. If both sides can be written with the same base, match the exponents. 3^(x + 1) = 27 is 3^(x + 1) = 3³, so x + 1 = 3 and x = 2. Reach for logs when the numbers aren't powers of the same base.

What mistakes do people make with logs?

The biggest one is splitting a log over a sum. log(a + b) is not log a + log b. For example, log(2 + 8) = log(10) = 1, but log 2 + log 8 ≈ 1.20411998266.

A similar slip is treating a quotient of logs as a log of a quotient. log(8) ÷ log(2) is about 3, but log(8/2) = log(4) ≈ 0.602059991328. Also watch the base: log on most calculators means base 10, not base e.

Frequently asked questions

Short answers to the questions people ask most about this topic.

What is log base 10 of 1000?

log(1000) = 3, because 10³ = 1000. When no base is written, log means base 10.

How do I enter a log with a different base?

Type log_2(32) or log(32, 2). Both mean log base 2 of 32, and both give 5.

Is this also an ln calculator?

Yes. Type ln( ) for the natural log, which uses base e. For example, ln(10) ≈ 2.30258509299 and ln(1) = 0.

What is the log of 1?

The log of 1 is 0 in every base, because any allowed base raised to the power 0 equals 1. So log(1) = 0 and ln(1) = 0.

Can you take the log of a negative number?

Not with real numbers. No power of a positive base is negative or zero, so log(−5) and log(0) are undefined and the calculator shows a domain error.

What is the change of base formula?

log_b(x) = ln(x) ÷ ln(b). It lets you find a log in any base using natural logs. For example, log₂(10) = ln(10) ÷ ln(2) ≈ 3.32192809489.

What is log base 2 of 8?

log₂(8) = 3, because 2³ = 8. Type log_2(8) or log(8, 2) to check it.

How are logs and exponents related?

They are inverses. log_b(x) = y means bʸ = x. The exponent calculator shows the forward direction, and this page goes back from the result to the exponent.

Math keypad

Calculate mode

Use the keypad below or tap the expression to use your phone keyboard.

Keyboard tips

Ctrl + Enter
Run the selected operation
a/b key
Select part of the problem first to wrap it in a fraction, root, power, or bars
sin(30)
Scientific functions work in Calculate mode; angles are in degrees unless you use π
^
Enter a power, such as x^2
sqrt(
Calculate an exact or simplified square root
a:b
Separate quantities in a ratio
12, 18
Separate integers in an LCM and GCD calculation
@ x =
Assign x when evaluating an expression
y =
Enter a polynomial function to graph
|
Wrap an absolute-value expression