CompoundPage

Log Calculator

A logarithm answers one question, what power turns the base into this number, and a log calculator answers it in any base.

Must be greater than zero. No real power of a positive base gives zero or less. In b^(ax + c) = number, the right-hand side.

10 for the common log, 2.718281828 for the natural log, 2 for binary.

log_10(1,000)3

log base 10 of 1,000 Which says 10 raised to the power 3 is 1,000.
3
Change of base Calculators and languages usually offer only natural log and log base 10, so every other base is computed as a ratio of two of them. The ratio is the same whichever of the two you use, which is the content of the change-of-base rule.
ln(1,000) / ln(10) = 6.9077553 / 2.3025851
Natural log, ln Base e, about 2.718281828. The one that appears in anything continuous (growth, decay, interest compounded instantaneously), because e is the base whose exponential is its own derivative.
6.907755279
Common log, log10 Base 10. Its whole part is the number of digits minus one, which is why it measures orders of magnitude: pH, decibels and the Richter scale are all log10.
3
Binary log, log2 Base 2. How many times a number can be halved, which makes it the natural unit of information and the reason a binary search over n items takes log2(n) steps.
9.965784285
Check Exponentiation undoes the logarithm. Any small discrepancy here is floating-point rounding, not an error in the method.
10^3 = 1,000
Orders of magnitude The floor of log10 plus one. This is the fastest use of a logarithm by hand: it turns 'how big is this' into a single small number.
1,000 has 4 digits

How the Log Calculator works

A logarithm is an exponent, and almost all the difficulty people have with it comes from that sentence not being said plainly enough. Asking for the log base 10 of 1000 is asking what power of 10 gives 1000. The answer is 3. That is the whole definition, and everything else is consequence.

Two bases dominate. Base 10 is the common log, and its usefulness is that its whole part counts digits: anything between 1000 and 9999 has a log10 between 3 and 4, so the logarithm turns "how big is this" into a single small number. That is why scales designed to span enormous ranges are logarithmic: pH, decibels, stellar magnitude, the Richter scale. A magnitude 7 earthquake is not slightly worse than a 6; it releases about 32 times the energy, because the scale is log10 of amplitude and energy goes as the three-halves power.

Base e is the natural log, written ln, with e about 2.718281828. It looks arbitrary and is not: e is the unique base whose exponential function is its own derivative, so anything that changes at a rate proportional to its current size (compound interest, radioactive decay, a population with unlimited food, the cooling of a cup of tea) has e in its solution. Continuous compounding is the cleanest example: a rate r for time t multiplies the principal by e^(rt), and no other base makes that formula simple.

Base 2 is the one computing uses. The log base 2 of a number is how many times it can be halved, which is why a binary search over a million items takes about 20 comparisons and why a bit is the unit of information: one bit distinguishes two possibilities, so distinguishing n of them takes log2(n) bits.

The change-of-base rule is what makes any base computable from any other. log base b of x equals ln(x) divided by ln(b), and the same works with log10 or any other base on top and bottom. Most calculators and most programming languages provide only natural log and log base 10, so every other base is computed exactly this way, including the one above.

What a logarithm cannot do is accept zero or a negative number. Raising a positive base to a more and more negative power gets arbitrarily close to zero without reaching it, so the log runs off to negative infinity as the input approaches zero and has no real value below it. The base itself must also be positive and not 1, because every power of 1 is 1 and so no exponent could produce anything else.

Log Calculator FAQ

What is a logarithm, simply?

An exponent. log base b of x is the power you raise b to in order to get x. log10(1000) is 3 because 10^3 is 1000. Once that sentence is clear, every logarithm rule is just an exponent rule read backwards.

What is the difference between log and ln?

The base. log conventionally means base 10 in most contexts and base e in some mathematical writing, which is why the ambiguity is worth avoiding; ln always means base e, about 2.718281828. On most calculators the LOG key is base 10 and the LN key is base e.

How do I calculate a log in a base my calculator does not have?

Change of base: divide the natural log of the number by the natural log of the base. log base 7 of 343 is ln(343)/ln(7) = 5.8377/1.9459 = 3. It works with log10 on top and bottom too, and gives the same answer, which is the point of the rule.

Why is log of zero undefined?

Because no real power of a positive base gives zero. Raising 10 to -1 gives 0.1, to -10 gives 0.0000000001, and so on. It approaches zero without arriving. So the logarithm tends to negative infinity as the input goes to zero and has no value at or below it.

Why is e used instead of a round number?

Because e is the only base whose exponential function equals its own derivative, which makes it the natural base for anything growing or decaying at a rate proportional to its own size. Choosing 10 instead would put an awkward constant into every such formula; choosing e removes it.

What does log2 tell me?

How many halvings. log2(1024) is 10, so a thousand items can be narrowed to one in ten yes-or-no questions. It is the reason binary search is fast, the reason a balanced tree has logarithmic depth, and the reason information is measured in bits.

Logarithmic equations

Related calculators

Embed this calculator
<div id="compoundpage-logarithm-calculator"></div>
<script src="https://compoundpage.com/embed/logarithm-calculator.js" async></script>

The same calculation as JSON