Logarithm Calculator
Compute log base b of any value - plus one-tap log₁₀, natural log (ln), and log₂. See the change-of-base working, with clear notes when the input has no real answer.
- Free, no account
- No watermark
- No usage limit
About the Logarithm Calculator
Most logarithm calculators hand you a number and nothing else. Type log₅(25), out comes 2, and you are left trusting a box you cannot see inside. Feed one an input it cannot handle, a negative, a zero, a base of 1, and it flashes Error or NaN with no clue what went wrong. This one is built to explain instead. It computes log_b(x) for any base, then shows the change-of-base division that produced the answer plus a check line that proves it, and when there genuinely is no answer it tells you which rule you tripped, in plain words. That reasoning is the part you actually need when you are learning logs or checking homework, not just the digit at the end.
One-tap presets cover the three you reach for most, common (base 10), natural (ln, base e), and binary (base 2), and you can type any base by hand, including the letter e for Euler's number. All of it runs in your browser, so nothing you type leaves your machine, and once the page has loaded it keeps working with no connection at all.
How to use
- Type the value in the first box, the number you want the log of. It has to be positive.
8,1000, and0.5all work,0and negatives do not. - Set the base. Tap log₁₀, ln, or log₂ for the three common ones, or type your own,
5,1.5, or the lettere. - Read the answer underneath. It updates as you type and writes the expression out in full, like
log₂(8) =, so you can see what it solved. - Look at the working. A dashed box shows the change-of-base step,
ln(x) ÷ ln(b), with the real numbers filled in. That is where the answer comes from, no hand-waving. - Use the check line. Below the result, the base raised to the answer should give your value back. If
log₂(8) = 3, then2³ = 8. That round trip is the whole idea of a log. - Tap an example in the
Try:row to watch it run.log₂(8),ln(e), andlog₅(25)are one tap away.
A log is just an exponent working backwards
If you can read 2³ = 8, you already understand logarithms, you just have not seen them written the other direction. With an exponent, you start with the base and the power and multiply your way to a result. A log comes at that same relationship backwards. You already have the result and you are trying to recover the power, so it is the same three numbers with a different one left blank. So log₂(8) = 3 is really asking "what power of 2 makes 8?", and the answer is 3 because 2 × 2 × 2 = 8. Whenever a log looks intimidating, rephrase it as a "what power" question and it usually falls apart in your head. Try log₃(81), what power of 3 gives 81, and since 3⁴ = 81 the answer is 4.
One formula runs every base
Any log calculator only computes two logs directly, the natural log and the common log. Every other base goes through the change-of-base formula:
log_b(x) = ln(x) ÷ ln(b)
That single identity is all a log calculator needs. Want log₅(25)? It becomes ln(25) ÷ ln(5), which is 3.2189 ÷ 1.6094 = 2, and 5² = 25 confirms it. Most calculators do that division silently and never show it. This one prints the exact step in the change-of-base box, with the real numbers filled in, so the number in front of you is never something you have to take on faith. You can use base 10 on top instead of ln and land on the identical answer, the only rule is the base up top has to match the base underneath.
Why some inputs have no answer, and the tool says which
Most calculators throw a vague error when a log is undefined. This one explains it, the reason is genuinely worth understanding rather than memorizing.
The value has to be positive. Asking for log₁₀(−5) is asking which exponent turns 10 into a negative number. There isn't one, since raising 10 to any real power lands above zero. 10² is 100, 10⁻³ is a tiny 0.001, 10⁰ is 1. You can make it enormous or a sliver above zero, never negative and never exactly zero. So no real exponent lands on a negative number, and the tool says log is undefined for x ≤ 0. It would rather tell you that than invent a value.
Zero is its own case. As the exponent runs toward negative infinity the result creeps toward zero without ever touching it. So log(0) has no value either, and heads off toward negative infinity instead.
The base can't be 1. Picture log₁(8), "what power of 1 gives 8?" But 1 to any power is just 1, forever, so nothing turns it into 8. A base of 0 or a negative base breaks for similar reasons. That leaves one valid rule, any positive base except 1, and the tool enforces exactly that and names the condition you hit instead of printing NaN. Handy when you are debugging a homework answer and cannot see why the textbook says "undefined."
The three you'll actually use
You can take a log in any base, but three carry their own names because they turn up everywhere.
Base 10, the common log. When log appears with no little base number, it almost always means this. log₁₀(1000) = 3, log₁₀(100) = 2, every whole step is another zero on the end. It is the fit for the decibel, Richter, and pH scales, which is why one step up any of them is a tenfold jump and not a small one. A magnitude 6 quake is about 100 times the ground motion of a magnitude 4, not 50 percent more.
Base e, the natural log (ln). Euler's number, about 2.71828, and the log behind every continuous-growth model, compound interest, populations, radioactive decay. If something changes by a percentage over time, ln is how you run it backwards to ask how long until it hits a target.
Base 2, the binary log. This counts doublings, so it shows up all over computer science. When an algorithm is O(log n), that log is base 2, counting how many times you can halve the problem. log₂ of a billion is about 30, which is why binary search finds one name in a billion-row list in roughly 30 steps.
One gotcha catches people, mathematicians sometimes write plain log to mean the natural log, not base 10. When it matters, spell it out as log₁₀ or ln. Setting the base yourself here removes the guess.
Frequently asked questions
How do I compute log₂ if my calculator only has "log" and "ln" buttons?
Divide one log by another. log₂(x) = ln(x) ÷ ln(2), or log(x) ÷ log(2) with the common-log button, same answer either way. So log₂(40) = ln(40) ÷ ln(2) ≈ 3.689 ÷ 0.693 ≈ 5.32. That is the change-of-base formula done by hand, exactly what a physical calculator with no base-2 button forces on you. This tool skips the step since you type the 2 straight in, but it is worth knowing why the division works when you are stuck with a basic calculator in an exam.
Why is my answer a long decimal instead of a clean whole number?
Because the value is not an exact power of the base. Tidy whole-number logs only happen on exact powers, log₁₀(1000) = 3 because 1000 is 10³. Take log₁₀(26) and 26 sits between 10¹ and 10², so its log falls between 1 and 2, at about 1.415. All that decimal is saying is 10^1.415 ≈ 26. Most real logs are decimals, and they are exact, not rounded off, they are the fractional exponent needed to reach a number that is not a neat power.
Does plain "log" mean base 10 or base e?
It depends who wrote it, which is the frustrating part. Engineers and most calculators read log as base 10. Plenty of mathematicians and higher-level texts read it as the natural log, base e. Computer scientists sometimes even mean base 2. There is no universal rule, so when the base actually matters, insist on the explicit log₁₀, ln, or log₂. Here you set the base outright, so there is nothing to misread.
Can I take the log of a negative number some other way?
Yes, but not with real numbers. Negative inputs do have logarithms in the complex-number system, where the answer involves i, the square root of negative one. That is a different tool and a different course, and it is almost never what someone typing into a quick log calculator is after. For everyday real-number work the log of a negative is simply undefined, which is what you will see here.
How do I go the other direction, from the log back to the value?
Raise the base to it. If log₂(x) = 5, then x = 2⁵ = 32. That is exponentiation, the exact inverse of taking a log, and it is what the check line under each result quietly does to prove the answer. If you need a lot of it, the exponent calculator is the direct reverse of this tool, and the scientific calculator handles a log tucked inside a bigger expression like 3 · log(x) + 2.
Is anything I type sent to a server?
No. Every calculation happens locally in your browser, on your own device. Nothing you enter is uploaded, saved, or tracked, and after the page loads it works fully offline. There is no round trip to anywhere, which is also why the answer shows up the instant you type.