Log Calculator

A free tool by DeepRit, a Google Ads agency that does PPC and nothing else. We build and run Google Ads accounts so every click is accounted for. Book a free audit call

Free log calculator. Work out the logarithm of a number in base 10, base e (ln), base 2 or any base, with every step and the inverse to check it.

ln x
0
log₁₀ x
0
log₂ x
0

Free, no sign-up. Runs in your browser: nothing you type is uploaded or saved.

How to use the log calculator

  1. Enter the number (x) you want the logarithm of. It must be greater than zero.
  2. Choose the base: 10 (the common log), e (the natural log, ln), 2 (the binary log) or any other positive base.
  3. Read the answer. The log calculator shows the logarithm in your chosen base, plus ln x, log₁₀ x and log₂ x side by side, and a check that raises the base to the answer to get your number back.

Exact results are shown as whole numbers: log₁₀(1,000) is exactly 3, not 2.9999999999.

What a logarithm is

A logarithm answers the question: what power do I raise the base to, to get this number?

log_b(x) = y means b^y = x

  • log₁₀(1,000) = 3, because 10³ = 1,000.
  • log₂(32) = 5, because 2⁵ = 32.
  • log₃(81) = 4, because 3⁴ = 81.

So logarithms are the inverse of exponents. If the exponent calculator answers "2 to the 10 is what?", the log calculator answers "2 to the what is 1,024?".

The three common bases

Base 10 (common logarithm, log or log₁₀). Used in science and engineering, and in scales such as pH, decibels and the Richter scale. log₁₀(x) roughly tells you how many digits a number has: log₁₀(50,000) = 4.699, and 50,000 has 5 digits.

Base e (natural logarithm, ln). e ≈ 2.71828 is the base of natural growth and decay. The natural log appears in calculus, compound interest with continuous compounding, population models, radioactive decay and statistics. ln(2) ≈ 0.6931 is the key number for doubling times.

Base 2 (binary logarithm, log₂). Used in computing and information theory. log₂(n) tells you how many bits are needed to count n things, and how many steps a binary search takes: searching a sorted list of a million items takes about log₂(1,000,000) ≈ 20 steps.

Logarithm rules

These rules turn multiplication into addition, which is why logarithms were invented (and why slide rules worked):

  • Product: log(a × b) = log(a) + log(b)
  • Quotient: log(a ÷ b) = log(a) − log(b)
  • Power: log(a^n) = n × log(a)
  • Log of 1: log_b(1) = 0 for any base
  • Log of the base: log_b(b) = 1
  • Change of base: log_b(x) = ln(x) ÷ ln(b)

The change-of-base formula is how the log calculator works out logs in any base, and how you can do it on a calculator that only has ln and log buttons.

Why logs of zero and negatives don't exist

No real power of a positive base gives zero or a negative number: 10^y is always positive. So log(0) and log(−5) aren't defined as real numbers, and the log calculator tells you that instead of returning an error code. As x gets closer to zero, its logarithm heads towards negative infinity.

Similarly, the base must be positive and not equal to 1, because 1 to any power is still 1.

Using logs to solve for time

Logarithms answer "how long until?" questions about growth:

Time to grow = ln(final ÷ start) ÷ ln(1 + rate)

At 5% a year, money doubles after ln(2) ÷ ln(1.05) = 14.21 years. In the log calculator, that's log base 1.05 of 2. The famous rule of 72 (72 ÷ 5 = 14.4 years) is a quick approximation of this; the rule of 72 calculator compares the two.

For average growth over a period, the CAGR calculator uses the same maths in reverse.

Logarithmic scales

Some quantities vary over such a huge range that they're measured on a logarithmic scale, where each step multiplies rather than adds:

  • pH: each step is a factor of 10 in hydrogen ion concentration. pH 4 is ten times more acidic than pH 5.
  • Decibels: every 10 dB is ten times the sound intensity; +3 dB is roughly double.
  • Earthquake magnitude: each whole number is about 32 times more energy released.
  • Star brightness and musical octaves (each octave doubles the frequency) work the same way.

Charts with a log scale show exponential growth as a straight line, which makes it easier to compare growth rates.

Antilogarithms

The antilog undoes the log: if log₁₀(x) = 2.5, then x = 10^2.5 = 316.23. In the log calculator, the check line shows the antilog of your answer, which should give your original number back. For any antilog, use the exponent calculator with the base and the log value.

Tips

  • ln and log are different: ln is base e, and log usually means base 10 (in some programming languages and advanced maths texts, log means ln, so check).
  • Use ln for continuous growth and log₁₀ for orders of magnitude.
  • For bits and computer science, use base 2.
  • Check results by raising the base to the answer.

Privacy and accuracy

Your numbers stay in your browser. The log calculator uses the browser's built-in Math.log, Math.log10 and Math.log2 functions, with the change-of-base formula for other bases, and snaps results that are within a trillionth of a whole number to that whole number. No AI is involved, so the same inputs always give the same results. Students, scientists, engineers and investors use it free on any device.

Logs in spreadsheets and code

To check results elsewhere:

  • Excel and Google Sheets: =LOG10(1000), =LN(2), =LOG(1024, 2) for any base.
  • JavaScript: Math.log10(x), Math.log(x) for ln, Math.log2(x).
  • Python: math.log10(x), math.log(x), math.log(x, base).

Watch out: in Excel, LOG(x) with no base means log base 10, while in JavaScript and Python, Math.log and math.log mean ln. Mixing these up is a classic bug, and the log calculator shows all three values side by side so you can spot which one you need.

Half-lives and decay

Logarithms also answer "how long until it's halved?". A substance with a half-life of 5,730 years (carbon-14) has decayed to 30% after log base 0.5 of 0.3 ≈ 1.737 half-lives, about 9,950 years. Choose "Other base", enter 0.5 and the fraction remaining to find the number of half-lives, then multiply by the half-life.

Orders of magnitude

The whole-number part of log₁₀(x) tells you the order of magnitude: log₁₀(50,000) = 4.699, so 50,000 is on the order of 10⁴. Scientists use this to compare things that differ enormously in size, from atoms to galaxies. The log calculator makes those comparisons quick.

Quick reference

  • log₁₀: common log, base 10.
  • ln: natural log, base e ≈ 2.71828.
  • log₂: binary log, base 2.
  • Antilog: the inverse, base^value.
  • Change of base: log_b(x) = ln(x) ÷ ln(b).

Common mistakes

  • Adding logs of a sum: log(a + b) isn't log(a) + log(b).
  • Using ln when the question means log₁₀, or the other way round.
  • Taking the log of zero or a negative number.

Logarithms in sound and light

Decibels compare sound intensities with a logarithm: dB = 10 × log₁₀(I ÷ I₀). A sound 100 times more intense than another is 20 dB louder, because log₁₀(100) = 2. Each 10 dB step is ten times the intensity, which is why hearing protection matters so much at concerts. Photographers meet logarithms too: each "stop" doubles or halves the light, so the number of stops between two light levels is log₂ of their ratio. The log calculator handles both in seconds: base 10 for decibels, base 2 for stops.

A worked example

A chemistry student is checking pH. A solution has a hydrogen ion concentration of 0.001 mol/L, and pH is −log₁₀ of that. He enters 0.001 with base 10: the log calculator gives −3, so the pH is 3.

Then, for a finance question, he wants to know how long money takes to double at 5% a year. He chooses "Other base", enters 1.05 as the base and 2 as the number. The answer is 14.2067, so just over 14 years. The check line confirms 1.05^14.2067 = 2.

Finally, he finds ln(2) = 0.693147, the constant that appears in every doubling-time formula.

Need more customers from Google?

This tool is free and runs in your browser. If your business also needs more leads or sales, Google Ads is where people search with their wallet out. DeepRit is a Google Ads agency that does PPC and nothing else: we build the campaigns, block the searches that waste money, write the ads, set up conversion tracking and send you a short report every week. Request a free PPC audit and we will show you, in dollars, what we would fix first.

Frequently asked questions

How do I calculate a logarithm?

Find the power you raise the base to, to get the number: log₁₀(100) = 2 because 10² = 100. The log calculator works it out for any base.

What is the difference between log and ln?

log usually means base 10; ln means the natural log, base e (about 2.71828).

How do I calculate log base 2?

Choose base 2 in the log calculator, or use log₂(x) = ln(x) ÷ ln(2).

What is log of 0?

It's undefined. Logs are only defined for numbers above zero.

How do I convert between log bases?

Use the change-of-base formula: log_b(x) = ln(x) ÷ ln(b).

Is the log calculator free?

Yes, completely free, with no sign-up.

Free PPC audit

See where your ad budget leaks.

We look at your Google Ads account before the call, then walk you through what we'd fix first, in dollars. No obligation, no hard sell.

Book a free audit call 30-minute call · Free · The audit is yours to keep