Uni-Sine
MathematicsNumber

Log calculator: logarithms in any base, with working

A logarithm answers the question: what power of the base gives this number? log₂ 8 = 3 because 2³ = 8. This log calculator works out logs in any base, including the natural log (ln, base e) and log base 10. It gives an exact answer where there is one, such as 3 or 2/3, and a decimal to 8 figures otherwise. It can also run a log backwards to find the number (the antilog) or the base, and show the log rules at work with your numbers.

It opens on log₂ 24, example 1 below. Change the base and the number, or open the full logarithm calculator over this page.

Try it

Logarithm Calculator

Evaluate logs in any base and see the log rules at work

Go to its page

What the log calculator can do

ModeYou enterIt findsExample
LogThe base and the numberThe loglog₂ 24 ≈ 4.585
NumberThe base and the value of the logThe number (the antilog)log₁₀ x = 2.5 gives x ≈ 316.2
BaseThe number and the value of the logThe baselog_b 125 = 3 gives b = 5
RulesA rule and two numbers m and nBoth sides of the rulelog₂ 8 + log₂ 4 = log₂ 32

Alongside the answer you also get the natural log and the common log (base 10) of the same number, the working step by step, and the point on the curve y = log x for that base. In Rules mode the rule is drawn as lengths on a ruler instead.

How to use the log calculator

  1. Choose a mode: Log, Number, Base or Rules.
  2. Type the Base. For a natural log, turn on Base e (natural log) instead. For log base 10, type 10.
  3. Type the Number, or the Value of the log in Number and Base modes.
  4. Read the answer at the top. It says Exactly when the log is a whole number or fraction, or To 8 figures when it isn't.
  5. Follow the working under it, and the point on the curve beside it.
  6. To practise, press Random problem in the Practice section.

The base must be positive and not 1, and you can only take the log of a positive number. The calculator tells you if either rule is broken.

How to calculate a log in any base

\log_b x = y \quad \text{means} \quad b^y = xA log is the power you raise the base to

If you can spot the power, you're done: log₃ 81 = 4, because 3⁴ = 81. When you can't, use the change of base formula, which turns a log in any base into a division of two logs your calculator already has, ln or log base 10:

\log_b x = \frac{\ln x}{\ln b} = \frac{\log_{10} x}{\log_{10} b}The change of base formula

This is what the calculator does when there's no exact answer, using natural logs. On a scientific calculator without a log base button, type ln x ÷ ln b.

Worked examples you can check in the calculator

Example 1: log base 2 of 24

24 isn't a power of 2, but 24 = 8 × 3, and 8 = 2³. The product rule splits it:

\log_2 24 = \log_2 (8 \times 3) = 3 + \log_2 3

So the answer is a bit more than 3 (and less than 5, since 2⁵ = 32). Change of base finishes it:

\log_2 24 = \frac{\ln 24}{\ln 2} = \frac{3.1780538}{0.69314718} = 4.5849625

log₂ 24 = 4.585 to 4 significant figures. Check: 2^4.585 is very close to 24. The calculator shows these same steps.

Example 2: an exact fraction

Work out log₈ 4. Both are powers of 2: 8 = 2³ and 4 = 2². The cube root of 8 is 2, so 8^(1/3) = 2, and squaring gives 8^(2/3) = 4. So log₈ 4 = 2/3 exactly, and the calculator shows it as a fraction with the decimal 0.66666667 underneath.

Example 3: natural log and log base 10

With Base e turned on and the number 20, the calculator gives ln 20 = 2.9957323. With base 10, log₁₀ 5000 = 3.69897, which makes sense because 5000 is between 10³ and 10⁴. Logs of numbers between 0 and 1 are negative: log₁₀ 0.001 = −3, because 10⁻³ = 0.001.

Example 4: the antilog (finding the number)

If log₁₀ x = 2.5, what is x? Choose Number mode, base 10, value 2.5. Rewriting the log as a power gives the answer straight away:

x = 10^{2.5} = 316.22777

This is the antilog. For a natural log, the antilog of y is eʸ.

Example 5: finding the base

If log_b 125 = 3, then b³ = 125, so b is the cube root of 125: b = 5. In Base mode, type 125 as the number and 3 as the value of the log.

Example 6: solving an exponential equation

Money grows by 5% a year. How long until it doubles? You need 1.05ᵗ = 2, and a log is exactly the tool for finding a power:

t = \log_{1.05} 2 = \frac{\ln 2}{\ln 1.05} = 14.2067

It takes about 14.2 years. In the calculator, use Log mode with base 1.05 and number 2. In the US, the Common Core standards for high school functions ask students to solve exponential equations like this by writing the answer as a logarithm and evaluating it with technology.

Try one

practice
Pick an answer, then check it.
What is log₂ 32?

The log rules in the calculator

Rules mode takes two numbers and works one rule through with them, checking that both sides really come to the same value. Choose the rule under Use the rule:

RuleStatementWith numbers, base 2
Productlog m + log n = log(mn)log₂ 8 + log₂ 4 = log₂ 32, and 3 + 2 = 5
Quotientlog m − log n = log(m/n)log₂ 32 − log₂ 4 = log₂ 8, and 5 − 2 = 3
Powerlog(mᵏ) = k log mlog₂ 8² = 2 log₂ 8 = 6
Base (change of base)log_b m = log_c m ÷ log_c blog₂ 8 = log₁₀ 8 ÷ log₁₀ 2 = 3

Common mistakes

  • Mixing up log and ln. On most calculators, log means base 10 and ln means base e. In some university books, log on its own means ln.
  • Dividing the numbers instead of the logs. log₂ 24 is ln 24 ÷ ln 2, not ln(24 ÷ 2).
  • Splitting a log of a sum. log(m + n) is not log m + log n. The product rule is for log(mn).
  • Taking the log of 0 or a negative number. No power of a positive base gives 0 or a negative number, so these logs don't exist in the real numbers.
  • Swapping the base and the number in change of base. The base goes on the bottom.

Common questions

How do you calculate log base 2?
Divide ln x by ln 2, or log₁₀ x by log₁₀ 2. For x = 24 that is 3.1780538 ÷ 0.69314718 = 4.585. In the calculator, type 2 as the base and your number.
What is the difference between log and ln?
ln is the natural log, with base e ≈ 2.718. log on a calculator usually means base 10. They are linked by ln x = log₁₀ x ÷ log₁₀ e.
What is an antilog?
Undoing a log. The antilog of y in base b is bʸ, so the antilog of 2 in base 10 is 100. Use Number mode in the calculator.
What is log of 1?
0, in every base, because any base to the power 0 is 1.
Can a log be negative?
Yes. The log of a number between 0 and 1 is negative when the base is bigger than 1. log₁₀ 0.01 = −2.
Why must the base not be 1?
Every power of 1 is 1, so 1 can't reach any other number, and log₁ of anything else has no answer.

Revision cards

Read the front, say your answer, then flip to check.

Where to go next

  • Solve it

    Logarithm Calculator

    Evaluate logs in any base and see the log rules at work

    Open the tool
  • Test it

    AP Precalculus

    A new exam-style paper every day, with instant marking and a mark scheme

    Start today's paper
Read next
Maths · AlgebraWhat is a logarithm? Logs explained with examplesWhat a logarithm is, how to read and work out logs, log base 10 and natural logs, the log rules and why they work, solving equations and real uses.