Home/Math/Log Calculator

Log Calculator

Calculate logarithms in any base, find antilogs, apply the change of base rule, or solve for the base — with the working shown.

Quick Answer: What Is a Logarithm?

A logarithm answers the question "what power do I raise the base to?" Since 10³ = 1000, log₁₀(1000) = 3. The three you meet most often are log₁₀ (common log), ln (natural log, base e ≈ 2.71828) and log₂ (binary log). Enter a number below, choose a base, and the calculator gives the exact result plus the same value in every common base.

Logarithm Calculator

The number must be greater than 0. The base must be greater than 0 and cannot be 1.

Result
log₁₀(1000)
3
because 10³ = 1000
Same number in every baseValue
Logs of zero and negative numbers do not exist. No power of a positive base ever produces 0 or a negative result — 10ˣ gets closer and closer to zero but never reaches it. This calculator says so plainly instead of showing NaN, which is what many tools do.

What Is a Logarithm?

A logarithm is the inverse of raising to a power. Where exponentiation asks "what is 10³?", a logarithm asks "10 to what power gives 1000?" Both describe the same relationship from opposite ends.

if bˣ = y  then  log_b(y) = x
example: 10³ = 1000  so  log₁₀(1000) = 3

What the letters mean. b is the base — the number being raised to a power. y is the value you have. x is the answer: the power required. Reading a logarithm aloud as "the power of b that gives y" makes most log problems easier to think about.

How to Use the Log Calculator

Four modes cover the questions people actually ask:

Type your values, or tap an example, then press Calculate or the Enter key. Every result comes with the same value expressed in base 10, base e and base 2, so you can cross-check against a textbook or a scientific calculator.

The Three Common Logarithms

NameWrittenBaseUsed in
Common logarithmlog or log₁₀10pH, decibels, the Richter scale, orders of magnitude
Natural logarithmlne ≈ 2.71828Growth and decay, calculus, compound interest
Binary logarithmlog₂ or lb2Computer science, information theory, algorithm analysis

A note on notation: in most school and engineering contexts log with no base means base 10, but in pure mathematics and many programming languages log means the natural logarithm. When it matters, write the base explicitly.

Log vs Exponential Form

Every logarithm can be rewritten as an exponential, and vice versa. They are the same statement viewed from two directions, and being able to switch between them is the single most useful skill in this topic.

Exponential formLogarithmic formRead it as
2³ = 8log₂(8) = 32 to the power 3 gives 8
10² = 100log₁₀(100) = 210 to the power 2 gives 100
10³ = 1000log₁₀(1000) = 310 to the power 3 gives 1000
e¹ = eln(e) = 1e to the power 1 gives e
5² = 25log₅(25) = 25 to the power 2 gives 25
3⁴ = 81log₃(81) = 43 to the power 4 gives 81
7³ = 343log₇(343) = 37 to the power 3 gives 343
10⁻³ = 0.001log₁₀(0.001) = −310 to the power −3 gives 0.001
b⁰ = 1log_b(1) = 0any base to the power 0 gives 1
b¹ = blog_b(b) = 1any base to the power 1 gives itself

The conversion pattern

bˣ = y  ⟷  log_b(y) = x
The base stays the base. The exponent becomes the answer. The result becomes the input.

A quick way to check your conversion: read the logarithm aloud as a question. log₂(8) asks "2 to what power gives 8?" — and the exponential form 2³ = 8 is the answer written out.

Logarithm Rules

product: log(ab) = log a + log b
quotient: log(a ÷ b) = log a − log b
power: log(aⁿ) = n · log a
change of base: log_b(x) = log_c(x) ÷ log_c(b)
identities: log_b(1) = 0 · log_b(b) = 1 · b^log_b(x) = x

These rules are why logarithms were invented. Before calculators, they turned multiplication into addition — which is exactly what a slide rule does mechanically. The product rule still matters today for simplifying equations and for keeping very large or very small numbers manageable.

Change of Base Rule

Most calculators only offer log₁₀ and ln, so any other base has to be converted. Divide the log of your number by the log of your base, using whichever base you do have:

log_b(x) = ln(x) ÷ ln(b)  =  log₁₀(x) ÷ log₁₀(b)

Worked example — log₇(343)

ln(343) = 5.83773044719
ln(7) = 1.94591014906
5.83773044719 ÷ 1.94591014906 = 3, since 7³ = 343

It works with either base on the bottom, which is a useful way to check your own arithmetic — both routes must give the same answer.

Antilogarithms

An antilogarithm undoes a logarithm. If log₁₀(x) = 3 then the antilog of 3 is 10³ = 1000. In modern notation it is just exponentiation, but the word survives from log tables, where you would look up a value and then reverse it in the antilog table.

antilog_b(y) =

The antilog of 2 in base 10 is 100, and the antilog of 1 in base e is e itself. Use the Antilog mode above for any base.

Worked Examples

1. log₁₀(1000)

Ask: 10 to what power gives 1000?
10 × 10 × 10 = 1000, so the power is 3
log₁₀(1000) = 3

2. log₂(8)

2 × 2 × 2 = 8
log₂(8) = 3

3. ln(e)

e¹ = e, so the power is 1
ln(e) = 1 — and log_b(b) = 1 for every valid base

4. log₁₀(0.001)

0.001 = 10⁻³
log₁₀(0.001) = −3 — numbers below 1 give negative logarithms

5. A non-whole answer: log₁₀(2)

2 sits between 10⁰ = 1 and 10¹ = 10, so the answer is between 0 and 1
log₁₀(2) ≈ 0.301029995664

6. Solving an equation

Solve 3ˣ = 81
x = log₃(81) = ln(81) ÷ ln(3)
x = 4, since 3⁴ = 81

7. Real life — pH

pH = −log₁₀(hydrogen ion concentration)
For 1 × 10⁻⁴ mol/L: −log₁₀(0.0001) = −(−4)
pH = 4 — acidic

8. Real life — decibels

A sound 1,000 times more intense than the reference: 10 × log₁₀(1000)
= 30 dB. Because the scale is logarithmic, every 10 dB is a tenfold jump in intensity.

Common Logarithm Values

xlog₁₀(x)ln(x)log₂(x)
0.001−3−6.907755−9.965784
0.1−1−2.302585−3.321928
1000
20.3010300.6931471
e ≈ 2.718280.43429411.442695
80.9030902.0794423
1012.3025853.321928
10024.6051706.643856
100036.9077559.965784
10243.0103006.93147210
1,000,000613.81551119.931569

Why Logs of 0 and Negative Numbers Are Undefined

A logarithm asks what power of the base produces your number. For a positive base, no power ever gives a negative result — 10² = 100 and 10⁻² = 0.01, both positive. As the exponent falls, the result shrinks toward zero without ever arriving, so log(0) has no answer either. Mathematically the limit heads to negative infinity.

Base 1 is excluded for a related reason: 1 raised to any power is always 1, so log₁(5) has no solution at all. A base of 0 or a negative base fails for similar reasons.

Where Logarithms Are Used

Finance

Working out how long an investment needs to reach a target, by solving for the exponent in compound interest.

t = ln(A/P) ÷ ln(1+r)

Artificial Intelligence

Log loss (cross-entropy) is the standard way to measure how wrong a model's predictions are during training.

loss = −Σ y·ln(ŷ)

Programming

Binary search and balanced trees run in log₂(n) steps, so a million sorted items need about 20 comparisons.

O(log n)

Chemistry

pH is a negative base-10 logarithm, so each whole unit is a tenfold change in acidity.

pH = −log₁₀[H⁺]

Engineering

Signal gain, filter response and Bode plots are all plotted on logarithmic axes to cover huge ranges.

gain = 20·log₁₀(V₂/V₁)

Earthquakes

The Richter scale is logarithmic — each whole number is roughly 32 times more energy released.

M = log₁₀(A/A₀)

Sound

Decibels are logarithmic because hearing responds to ratios. Every 10 dB is ten times the intensity.

dB = 10·log₁₀(I/I₀)

Statistics

Log transforms turn skewed data and exponential curves into straight lines that are easier to model.

log-normal, log-log plots

Applications in Detail

Chemistry — pH. pH = −log₁₀[H⁺]. A drop of one pH unit means ten times more acidic, which is why pH 3 is a hundred times more acidic than pH 5.

Sound — decibels. Loudness is logarithmic because human hearing is. A 60 dB conversation is a million times more intense than the 0 dB threshold of hearing.

Earthquakes — the Richter scale. Each whole number is roughly 32 times more energy released, so a magnitude 7 is not slightly worse than a 6 — it is vastly worse.

Computer science. Binary search runs in log₂(n) steps, which is why searching a million sorted items takes about 20 comparisons rather than a million.

Finance. Working out how long an investment takes to reach a target uses logarithms to solve for the exponent in the compound interest formula.

Biology and medicine. Bacterial growth, drug half-lives and radioactive decay are all exponential, so logarithms turn their curves into straight lines that are easier to read.

Common Mistakes

Watch out for these:
  • Confusing log and ln. log is usually base 10, ln is base e. Check which the formula intends.
  • Assuming log(a + b) = log a + log b. That rule applies to multiplication, not addition. There is no simple rule for the log of a sum.
  • Taking the log of zero or a negative number. Neither exists for a positive base.
  • Using base 1. Since 1ˣ is always 1, a base of 1 gives no solution.
  • Dividing the wrong way in change of base. It is log(number) ÷ log(base), not the reverse.
  • Forgetting that log₁₀ of a number under 1 is negative. log₁₀(0.001) = −3.
  • Rounding too early. Keep full precision through a multi-step calculation.

Practice Questions

Beginner (with answers)

  1. What is log₁₀(100)?
  2. What is log₂(16)?
  3. What is ln(1)?
  4. What is log₅(125)?
  5. What is log₁₀(0.1)?
Show answers

1) 2   2) 4   3) 0   4) 3   5) −1

Advanced (with answers)

  1. Solve 2ˣ = 64.
  2. Use change of base to find log₇(343).
  3. If log_b(81) = 4, what is b?
  4. Simplify log(8) + log(125) in base 10.
  5. What is the antilog of −2 in base 10?
Show answers

1) x = 6   2) 3   3) b = 3   4) log(1000) = 3   5) 0.01

Did you know? John Napier published the first logarithm tables in 1614, and they cut the time needed for astronomical calculations so dramatically that Laplace later said they "doubled the life of the astronomer". Slide rules, built on logarithmic scales, remained standard engineering equipment until pocket calculators arrived in the 1970s.
Pro tip. The whole-number part of a base-10 logarithm tells you the number of digits. log₁₀(45,678) ≈ 4.66, and 45,678 has five digits — one more than the integer part.
Pro tip. Memorise log₁₀(2) ≈ 0.301 and log₁₀(3) ≈ 0.477. With the product and power rules you can estimate most common logs mentally: log(6) = log(2) + log(3) ≈ 0.778.

🔑 Key Takeaways

  • A logarithm is the power a base must be raised to: bˣ = y means log_b(y) = x
  • log is base 10, ln is base e, log₂ is base 2
  • Change of base: log_b(x) = ln(x) ÷ ln(b)
  • log_b(1) = 0 and log_b(b) = 1 for every valid base
  • Logs of 0, negative numbers, and base 1 are undefined

Frequently Asked Questions

What is a logarithm?

A logarithm is the power to which a base must be raised to produce a given number. Because 10 cubed is 1000, the base 10 logarithm of 1000 is 3.

How do you calculate a logarithm?

Ask what power of the base gives your number. For bases your calculator does not offer directly, divide the natural log of the number by the natural log of the base.

What is the difference between log and ln?

log normally means base 10 and ln means base e, approximately 2.71828. In pure mathematics and many programming languages, log on its own can mean the natural logarithm, so it is safest to state the base.

What is the natural logarithm?

The natural logarithm uses base e, about 2.718281828. It appears wherever quantities grow or decay continuously, which makes it the standard logarithm in calculus, physics and finance.

What is log base 10?

The base 10 or common logarithm counts powers of ten. It underpins pH, decibels and the Richter scale, and its whole number part tells you the order of magnitude.

What is log base 2?

The binary logarithm counts powers of two. It is central to computer science, because it gives the number of times a quantity can be halved, which is the running time of binary search.

What is the change of base formula?

log base b of x equals log base c of x divided by log base c of b. In practice you divide the natural log of the number by the natural log of the base, which lets any calculator handle any base.

What is an antilog?

An antilogarithm reverses a logarithm. If the base 10 log of a number is 3, the antilog of 3 is 10 to the power 3, which is 1000. In modern notation it is simply exponentiation.

Why is log of 0 undefined?

No power of a positive base ever produces 0. As the exponent decreases the result shrinks toward zero without reaching it, so the logarithm has no value and heads toward negative infinity.

Why is log of a negative number undefined?

A positive base raised to any real power always gives a positive result, so no real exponent can produce a negative number. Logarithms of negative numbers exist only in complex analysis.

Why can the base not be 1?

1 raised to any power is always 1, so a base of 1 could never produce any other number. That makes the logarithm undefined, which is why bases must be positive and not equal to 1.

What is log of 1?

The logarithm of 1 is 0 in every valid base, because any base raised to the power 0 equals 1.

What are the logarithm rules?

The log of a product is the sum of the logs, the log of a quotient is the difference of the logs, and the log of a power moves the exponent to the front as a multiplier.

Can you take the log of a fraction?

Yes, as long as it is positive. Fractions between 0 and 1 give negative logarithms, so the base 10 log of 0.001 is minus 3.

How do you solve an exponential equation with logs?

Take the logarithm of both sides and use the power rule to bring the exponent down. To solve 3 to the power x equals 81, take logs to get x equals log of 81 divided by log of 3, which is 4.

How is pH calculated with logarithms?

pH is the negative base 10 logarithm of the hydrogen ion concentration. A concentration of 1 times 10 to the minus 4 gives a pH of 4, and each whole pH unit represents a tenfold change in acidity.

How are decibels related to logarithms?

Decibels use a base 10 logarithmic scale because human hearing responds to ratios rather than absolute differences. Every 10 decibel rise represents ten times the sound intensity.

Why are logarithms used in computer science?

Binary logarithms describe how many times data can be halved, which measures the efficiency of algorithms such as binary search and the depth of balanced trees.

Who invented logarithms?

John Napier published the first tables of logarithms in 1614, and Henry Briggs later developed the base 10 form. They transformed astronomy and navigation by turning multiplication into addition.

Is this Log Calculator free?

Yes. It is free with no sign-up, works on any device, and runs entirely in your browser so your entries stay private.

References

Last updated: July 2026
Reviewed by Mohsin Iqbal using standard mathematical definitions and trusted educational references. Base 10, base 2 and natural logarithms use dedicated high-precision functions rather than a generic division, so exact values such as log₁₀(1000) = 3 are returned without floating-point drift. Undefined cases are reported in plain language instead of NaN. This page is for educational purposes.