Math calculator

Log Calculator

Logarithms in any base, with the power they are really asking about.

Logarithm, any base

What power gives this?

Base 10, 2, or the letter e for the natural log. Any positive base but 1.

log₂(1024)

10

Because 2¹⁰ = 1024.

The answer

10

exact — the power was checked

As a power

2¹⁰ = 1024

the same statement, the other way round

Base

2

written log₂

Sign

positive

the number is above 1

Change of base

  • ln 1024 ÷ ln 2 = 6.9314718056 ÷ 0.69314718056 = 10
  • log 1024 ÷ log 2 = 3.01029995664 ÷ 0.301029995664 = 10

A calculator with only ln and log₁₀ still does every base. Divide one logarithm by the other and the base cancels — which is why both lines above give the same answer.

The laws, on your numbers

Each logarithm law applied to the values entered
log(ab) = log a + log blog₂(1024) + log₂(2) = log₂(2048)
log(a/b) = log a − log blog₂(1024) − log₂(2) = log₂(512)
log(aⁿ) = n log alog₂(1048576) = 2 × 10 = 20
log_b(b) = 1 and log_b(1) = 0log₂(2) = 1, log₂(1) = 0

Every one of these is the matching exponent law read backwards. Multiplying numbers adds their exponents, so it adds their logarithms.

  • A logarithm asks a question about a power: log₂(1024) is the answer to "what power of 2 gives 1024?" — and the answer is 10, because 2¹⁰ = 1024.
  • This one comes out exactly. 1024 is a whole power of 2, so the answer is an integer rather than a decimal that happens to look like one — the engine checks the power before it reports the number.
  • Base 2 counts doublings, which is why it appears wherever something halves or doubles: binary search depth, tree height, bits needed to store a number, and entropy in information theory.

A whole-number answer is confirmed by raising the base back to it before it is reported as exact.

What this tool shows

A logarithm asks a question about a power: log₂32 is 5 because 2⁵ = 32. Every rule follows from that reading, and a whole-number answer is confirmed by raising the base back to it rather than trusted from a float.

  • Logarithms in any positive base except 1
  • The exponential form beside every answer
  • Exact whole answers, confirmed rather than rounded
  • Change of base, both through ln and through log
  • Why log of zero and of a negative have no value
  • The laws, applied to your own numbers
Any base but 1 Exact answers confirmed Change of base shown The laws on your numbers

Exact answers verified by raising the base back.

Updated 7 September 2026 · Works in any browser, no installation

log_b(x) asks what power of b gives x. log₂(1024) is 10 because 2¹⁰ = 1024. That reading explains every rule: multiplying numbers adds their exponents, so it adds their logarithms; raising to a power multiplies the exponent, so it multiplies the logarithm. A calculator with only ln and log₁₀ still does every base, because log_b(x) = ln x ÷ ln b.

At a glance

Formula shown
log_b(x) = y means b^y = x. Change of base: log_b(x) = ln x / ln b = log x / log b. The laws: log(ab) = log a + log b, log(a/b) = log a \u2212 log b, log(a\u207f) = n log a.
Scenario support
Finding how many doublings something took; converting a ratio into decibels or pH; solving for an exponent in a growth equation.
Educational estimate
Planning support from the values you enter — not professional advice.

What a logarithm actually asks

Every logarithm is a question about a power. log₂32 asks: what power of 2 gives 32? The answer is 5, because 2⁵ = 32.

Written that way, most of the confusion disappears. A logarithm is not a new operation so much as the exponent read off the other side of the equation.

This page states the exponential form beside every answer for exactly that reason. If the answer looks wrong, the power is where to check it.

Change of base

A calculator with only ln and log₁₀ still does every base, because log_b(x) = ln x ÷ ln b.

The base cancels. Both numerator and denominator are measured in the same units, so the ratio does not care which logarithm you used — which is why the natural and common versions above give identical answers.

It also explains why all logarithm graphs have the same shape. They differ only by a constant factor, so log₂ is ln stretched by 1/ln 2 — not a different curve.

Why zero and negatives have no log

A positive base raised to any real power is positive. So nothing you can put in the exponent produces zero or a negative, and no logarithm of them exists.

For zero it is a limit rather than a gap: as the exponent goes more and more negative, the power gets closer to zero without ever arriving. That is why the graph has a vertical asymptote at zero rather than a point.

Complex logarithms of negatives do exist — ln(−1) = iπ — but they are many-valued, since adding 2πi to any answer gives another. That is a genuinely different subject rather than an extension of this one.

ln, log and log₂

ln is base e ≈ 2.71828. It is natural because it is the one whose derivative is 1/x with no constant attached; every other base picks up a factor of ln b, which is the change-of-base division showing up in calculus.

log usually means base 10, and it counts digits: the common log of any whole number is one less than its digit count. That is why it is behind the decibel, the pH scale and the Richter magnitude.

log₂ counts doublings, so it appears wherever something halves or doubles — binary search depth, tree height, bits needed to store a number, entropy.

The notation is not universal. In computer science log often means base 2; in some textbooks it means base e. When it matters, write the base.

The laws, and where they come from

log(ab) = log a + log b. Multiplying numbers adds their exponents, and the logarithm IS the exponent. That is the whole derivation.

log(a/b) = log a − log b for the same reason, with division subtracting exponents.

log(aⁿ) = n log a, because raising a power to a power multiplies the exponents.

This is the property that made logarithms indispensable for three centuries: they turn multiplication into addition. Slide rules, log tables and the whole of pre-electronic computation ran on it.

Where logarithms turn up

Solving for an exponent. If 2ⁿ = 1000, then n = log₂1000 ≈ 9.97. Any growth question that asks “how long” is a logarithm.

Compressing a range. Sound, earthquakes and acidity all span so many orders of magnitude that a linear scale is useless. Decibels, Richter and pH are all logarithmic for that reason.

Algorithm cost. Halving a problem repeatedly takes log₂n steps, which is why binary search on a million items takes about twenty comparisons rather than a million.

Sources and methodology

Logarithms are settled; these are the references for the conventions and the named bases.

Method. The value is computed by change of base through the natural logarithm. Before it is reported, the answer is rounded to the nearest integer and the base raised back to that integer: only if the result matches the input is the answer reported as exact. That is why log₂(1024) reads 10 here rather than 9.999999999999998, which is what the division alone produces. That engine is verified on every change against 68 hand-written assertions, including that every whole power of bases 2, 3, 5 and 10 is reported as an exact integer rather than as a decimal that rounds to one. The count and the per-case breakdown are published on the formula verification page.

Related calculators

Where this goes next:

ExponentPowers with the awkward cases right — a negative exponent is a reciprocal not a sign, a fractional one is a root, and zero to the zero is reported as contested.
Square RootThe exact square root first — 72 gives 6 root 2 — then the decimal to as many as sixty places, computed on whole numbers rather than a double.
FactorialFactorials with every digit exact — 100 factorial is 158 of them — plus the trailing-zero count derived from Legendre's formula and Stirling's error.
Cube RootCube roots exactly, negatives included — the cube root of minus 27 is minus 3, a real answer — with the two complex roots named alongside.
Doubling TimeHow long a quantity takes to double at a constant rate, or from two measurements — with the rule of 70 and rule of 72 measured against the exact answer.
Exponential GrowthGrowth, decay, doubling time and half-life from one rate — with the widening period-on-period change that is what exponential actually means.

More in Math, or browse all calculators.

Read the guide

The inverse operation is the Exponent Calculator, and reading the two side by side is the fastest way to see why the log laws look the way they do. For growth problems specifically, the Doubling Time Calculator answers the commonest one directly.

Educational use disclaimer

This is an educational tool. Exact answers are confirmed by raising the base back to them; everything else is shown to twelve significant figures and is a truncation of an irrational number.

How we calculate · Found an error? email us

Authorship & verification

Written and maintained by , a business operator who builds spreadsheet-based calculators.

What's changed (3 updates)

Published 7 September 2026

  1. Published the log page leading with the exponential form, because that is what a logarithm is: log base 2 of 32 is 5 because 2 to the 5 is 32.
  2. An exact whole answer is confirmed by raising the base back to it before being reported, so log base 2 of 1024 reads 10 rather than 9.999999999999998 — which is what the division alone produces.
  3. Log of zero and of a negative are refused with the reason, which is a fact about exponentials rather than a limitation of the tool.

Add this calculator to your site

Responsive embed — and private: nothing your visitors type leaves their browser.