Logarithm Calculator

Work out log base b of x for any positive base, including the common log (base 10), the natural log (base e) and the binary log (base 2). Switch the calculator round to solve for x or to solve for the base instead. Working shown via the change-of-base formula, with an inverse check on every answer.

Explain like I'm 5 (what even is this calculator?)

A logarithm asks the question "what power do I raise this base to, to get this number?". Two cubed is eight, so log base 2 of 8 is 3. Ten squared is a hundred, so log base 10 of 100 is 2. That is the whole game. Type in your numbers, pick your base, and the calculator does the arithmetic and shows you exactly how it got there.

Calculate

Browser-only. The numbers you enter are processed in your browser. Nothing is uploaded.

Logarithms are only defined for positive values. The base must be positive and cannot equal 1.

Enter a value and press Calculate.

Prove it

    Method: change-of-base, log_b(x) = ln(x) / ln(b). Inverse modes use x = b^result and b = x^(1/result) respectively.

    Useful? Save this calculator: press Ctrl + D to bookmark it.

    Useful logarithm identities to keep in your head

    Logarithms compress multiplication into addition, which is why they show up everywhere from sound levels (decibels) to earthquake scales (Richter) to information theory (bits, base 2) to the pH scale in chemistry. The identities below are the ones worth remembering, because they let you re-shape any expression into a form you can compute by hand or with this calculator.

    • Product: log_b(xy) = log_b(x) + log_b(y). Multiplying inside becomes adding outside.
    • Quotient: log_b(x / y) = log_b(x) − log_b(y). Dividing inside becomes subtracting outside.
    • Power: log_b(x^n) = n · log_b(x). An exponent inside hops out as a multiplier.
    • Change of base: log_b(x) = log_k(x) / log_k(b) for any other valid base k. This is how computers compute log base 2 or base 7 from a built-in natural log.
    • Inverse: b^(log_b(x)) = x and log_b(b^x) = x. The exponential function and the logarithm undo each other when the bases match.
    • Special values: log_b(1) = 0 for any valid base, because anything to the power zero is one. log_b(b) = 1 for any valid base, because anything to the power one is itself.

    When you actually need a logarithm

    Anywhere a quantity grows or shrinks by a constant ratio rather than a constant amount. Compound interest doubles your money in a fixed number of years, not a fixed number of pounds. Bacterial cultures multiply by a factor every twenty minutes. Sound intensity perceived by the ear is roughly logarithmic in physical pressure, which is why a 10 dB jump sounds about twice as loud rather than 10 units louder. Any time the question is "how many times do I have to multiply by this factor to get from here to there", you are asking a logarithm.

    Common mistakes the calculator helps you avoid

    Mixing up log and ln. Most scientific calculators have separate buttons. log usually means base 10 and ln always means base e. If a textbook just writes log without specifying, check the convention of the field: maths usually means base e, engineering usually means base 10, computer science usually means base 2.

    Trying to take the log of a negative. log_b(−5) has no answer in the real numbers. The calculator catches this and tells you, rather than returning NaN with no explanation.

    Trying to use a base of 1. 1 to any power is still 1, so log_1(x) is undefined for any x other than 1, and indeterminate when x is 1. The calculator rejects base 1 with a clear message.

    Confusing the inverse. If log_b(x) = y, then x = b^y, not y^b. The "inverse check" line on the result is there precisely to make this explicit, so you can sanity-check the answer at a glance.

    Related calculators

    Logs are one of the school-algebra workhorses. These are the others.

    Frequently asked questions

    What is a logarithm, in plain English?

    A logarithm is the exponent question turned around. If b raised to some power gives you x, the logarithm log base b of x is that power. So because 10 cubed is 1000, log base 10 of 1000 is 3. It is the same maths as exponentiation, just asking the other side of the question.

    What is the change-of-base formula?

    log base b of x equals ln(x) divided by ln(b). Any natural log on a calculator can be re-expressed as a log in any other base, which is exactly how this tool computes the answer for arbitrary bases.

    Why do logarithms reject zero and negative numbers?

    In the real numbers there is no exponent of a positive base that gives a zero or a negative result. b to the power of anything stays positive when b is positive. The logarithm is only defined on positive inputs without stepping into complex numbers.

    What is the difference between log, ln and log10?

    ln is the natural logarithm, base e (about 2.71828). log10 is the common logarithm, base 10. Plain log on its own is ambiguous: maths textbooks tend to mean log base e, engineering textbooks tend to mean log base 10, and computer science tends to mean log base 2. Always state the base if there is any doubt.

    Does this calculator send my numbers anywhere?

    No. Everything runs in your browser using vanilla JavaScript. The numbers you type never leave your device. You can disconnect from the network and the calculator still works.