To calculate a logarithm value, treat the logarithm as the inverse of exponentiation: if b^y = x, then log_b(x) = y, meaning you are solving for the unknown exponent y. Pick the base b and the argument x (which must be greater than 0), then find the exponent that turns b into x. In practice this shows up as ln(x) when the base is e ≈ 2.71828 (natural log), as log10(x) when the base is 10 (common log), and as log2(x) when the base is 2 (binary log). For any other base you rewrite the problem with the change-of-base formula log_b(x) = ln(x) ÷ ln(b), which is how a calculator that only knows ln and log10 can still evaluate log5, log7, or anything else. A Logarithm Calculator returns log_b(x), ln(x), log10(x), and log2(x) the moment you stop typing, along with the plain-language exponent (for example, 2^3 = 8) so the answer is not just a number but a clear statement of which power produces which result.

What "Calculating a Logarithm" Actually Means
A logarithm value is the answer to the question "to what power must a given base be raised to produce this number?" Put into symbols, log_b(x) = y is shorthand for b^y = x. The base b sits underneath the log, the argument x sits inside, and the result y is the exponent that makes the equation true. Asking for log2(8) is the same as asking "2 to what power gives 8?" Because 2^3 = 8, the answer is 3.
The same number can have a different logarithm value for every different base. log10(1000) asks "10 to what power gives 1000?" and the answer is 3 because 10^3 = 1000. ln(1000) asks the same kind of question with base e ≈ 2.71828, so the answer is roughly 6.908, not 3. Nothing about the argument changed — only the base did. The logarithm value always reports an exponent, and the exponent's size depends on the base you chose.
Because of this, a complete calculation of a logarithm value really has three pieces: the argument x, the base b, and the rule used to combine them. For natural log, common log, and binary log there are dedicated functions; for everything else the change-of-base formula folds the calculation back onto those dedicated functions.
How to Calculate Logarithm Values Step by Step
The fastest path from a question like "what is log_b(x)?" to a numeric answer is to type it into a calculator that handles the change of base internally. Here is the exact sequence.
- Decide which number is the argument. Pick x — the number whose logarithm you need — and confirm it is greater than 0. Zero and negative numbers have no real logarithm value.
- Decide which base you want. Use 10 for the common log, e for the natural log, 2 for the binary log, or any positive number not equal to 1 for a custom base.
- Type the argument into the Argument (x) field of the Logarithm Calculator. Results begin to appear the moment you stop typing, with no button to press.
- Type the base into the Base field, or leave it blank to default to e and get ln(x) instead.
- Read log_b(x) directly under the inputs. Below it you will also see ln(x), log10(x), and log2(x) for the same argument, so you can compare all four values at once.
- Confirm the exponent reading shown beneath the result (for example, "2^3 = 8" for log2(8)). That line tells you which power of the base equals the argument, which is the meaning of the logarithm value.
If you ever want the steps by hand instead, the same six-step outline applies: choose the base, rewrite the calculation as ln(x) ÷ ln(b), evaluate both natural logs, then divide.
The Change of Base Formula and Why It Handles Every Base
The single identity that makes logarithm values computable in any base is log_b(x) = ln(x) ÷ ln(b). That is, take the natural log of the argument, divide by the natural log of the base, and you have the logarithm value. The formula works because every logarithm is proportional to every other logarithm, and ln is the most convenient reference. Even a calculator that only ships ln and log10 buttons can therefore evaluate log5, log7, log3, or any other positive base — it just routes every calculation through the natural log internally.
The same identity is also why a calculator can stay fast and accurate. For the three bases that show up most often — 2, 10, and e — the Logarithm Calculator calls the browser's built-in high-precision functions directly, so whole-number answers like log2(8) come out as exactly 3 rather than 2.9999999999999996. For other bases it uses the change-of-base identity above. Tiny floating-point noise from the division is trimmed to twelve significant figures, which is enough to clean a stray 3.0000000000000004 back to 3 without ever hiding a real fractional result.
Because the calculation runs locally in your browser, nothing is sent to a server, the result updates as you type, and the same logic works offline once the page has loaded.
ln vs log10 vs log2: When Each Logarithm Value Is Used
Most real-world logarithm problems fall into one of three buckets, and each bucket comes with a different base and a different expected value. The table below summarizes which logarithm value belongs to which field and where you will see it in practice.
| Logarithm | Base | Common name | Typical fields and uses |
|---|---|---|---|
| ln(x) | e ≈ 2.71828 | Natural log | Continuous compound growth, exponential decay and half-life, calculus, differential equations |
| log10(x) | 10 | Common log | pH in chemistry, sound level in decibels, the Richter scale for earthquakes, stellar magnitudes |
| log2(x) | 2 | Binary log | Information entropy in bits, depth of a balanced binary tree, O(log n) running time in algorithms |
If your problem sits in the first row, compute ln(x). If it sits in the second row, compute log10(x). If it sits in the third row, compute log2(x). Anything else — say log5(125) in a number-theory problem — falls back to the change-of-base formula above, and the same calculator returns the value alongside the three standard ones.
Worked Example: Finding the Value of log5(125)
Suppose you need the logarithm value of 125 in base 5. The question written out is "to what power must 5 be raised to produce 125?" — or in symbols, log5(125).
By inspection of powers of 5: 5^1 = 5, 5^2 = 25, 5^3 = 125. The third power lands exactly on 125, so log5(125) = 3.
Confirming through the change-of-base formula: log5(125) = ln(125) ÷ ln(5). Because 125 = 5^3, you can also use the power rule for logarithms: ln(5^3) = 3·ln(5). Dividing ln(125) by ln(5) is the same as dividing 3·ln(5) by ln(5), which cancels to 3. The two paths agree exactly.
For values that do not come out as a clean integer — log10(7) ≈ 0.845098, for example, or ln(7) ≈ 1.945910 — the calculator returns the full decimal expansion and uses an approximately-equal sign so the answer stays honest about being irrational. Whole-number results use an equals sign, fractional results use ≈, and you can tell at a glance whether the exponent is exact.
Inputs That Make a Logarithm Value Undefined
Logarithms are defined for a narrower set of inputs than most functions, and a good calculator enforces those limits instead of returning a broken value. The two interacting rules are:
- The argument x must be greater than 0. A positive base raised to any real exponent always stays positive, so no exponent can ever produce 0 or a negative number — those inputs simply have no logarithm value. The calculator returns a clear undefined message rather than NaN or -Infinity.
- The base must be greater than 0 and not equal to 1. A base of 1 would make ln(b) = 0 and force a division by zero inside the change-of-base formula, and every power of 1 is just 1, so base 1 could never reach any other number. Bases less than 0 are excluded for the same reason — fractional exponents of a negative base are not real numbers.
As long as both rules hold, the logarithm value is a single real number. Once either rule is broken, the calculation has no real-number answer, and any tool that quietly prints NaN should be replaced by one that states the constraint explicitly.
Because the inputs are simple — one positive argument and one positive base not equal to 1 — and because the same calculator handles ln, log10, log2, and every other base at once, the practical process of computing a logarithm value reduces to: type x, optionally type b, read the result. The change-of-base identity, the floating-point trimming, and the explanation line beneath the result all run in the background.
If you're weighing options, Digits of Pi Example: 10 to 10,000 Decimal Places covers this in detail.