Compute logarithms in any base — common log (log₁₀), natural log (ln), binary log (log₂), or any custom base — with full change-of-base working.
Results update live as you type.
log₁₀(1000)
log₁₀(x)
3
common log
ln(x)
6.907755
natural log (base e)
log₂(x)
9.965784
binary log
log_b(x)
3
current base b = 10
| Identity | Form | Example |
|---|---|---|
| Product | log(xy) = log x + log y | log(6) = log 2 + log 3 |
| Quotient | log(x/y) = log x − log y | log(5/2) = log 5 − log 2 |
| Power | log(xⁿ) = n · log x | log(2⁵) = 5 log 2 |
| Identity | log_b(b) = 1 | log₁₀(10) = 1 |
| Zero | log_b(1) = 0 | ln(1) = 0 |
| Change of base | log_b(x) = ln x / ln b | log₂(8) = ln 8 / ln 2 = 3 |
The Definition
A logarithm is the inverse of exponentiation. The statement log_b(x) = y is exactly the same as b^y = x. So log₁₀(1000) = 3 because 10³ = 1000. Calculators normally only have log₁₀ and ln built in — to compute a log in any other base you use the change-of-base formula: log_b(x) = ln(x) / ln(b). Logs have neat properties that turn multiplication into addition (the original purpose of slide rules and log tables) and turn powers into multiplication.
Working for your inputs
About This Tool
A log calculator computes logarithms in any base. The three logs that show up in everyday work are the common log (base 10, written log or log₁₀), the natural log (base e ≈ 2.71828, written ln), and the binary log (base 2, written log₂ or lb). This tool returns all three at once, plus your custom base result, every time you change the argument.
Logarithms were invented by John Napier in 1614 as a way to turn the painful multiplication of long decimal numbers into much easier addition: log(a · b) = log(a) + log(b). For 350 years scientists and engineers carried log tables and slide rules everywhere. Today the practical use has shifted — logs underpin the decibel scale for sound, the Richter scale for earthquakes, the pH scale in chemistry, information theory (entropy in bits = log₂), and algorithm analysis in computer science (O(log n) is binary search; O(n log n) is mergesort).
Mathematically, this calculator uses JavaScript's Math.log (natural log) and Math.log10/Math.log2 for the canonical bases, with the change-of-base formula log_b(x) = ln(x) / ln(b) for any custom base. Results are exact up to IEEE 754 double precision — about 15–17 significant digits.
Use this free log calculator for homework, physics, chemistry, finance (doubling time = ln 2 / r), computer science, or any time you need to invert an exponential. Everything runs in your browser — no sign-up, no tracking, no data leaves your device.
Any Base
log₁₀, ln, log₂ presets plus any custom base you supply.
All Three at Once
Common, natural, and binary log shown side by side.
Inverse Check
Confirms b^y = x — a built-in sanity verification.
Change-of-Base Working
Step-by-step ln(x) / ln(b) so you can show your work.
100% Free & Private
No account, no tracking — every calculation runs locally in your browser.
Curve Visualisation
Plot of y = log_b(x) with your specific point marked.
Pick a base, type the argument, read the answer.
Choose log₁₀, ln, log₂, or Custom. The first three are by far the most common — pick one before reaching for a custom base.
Type the number you want the log of, into x. The argument must be strictly positive — there is no real logarithm of zero or negative numbers.
If you picked "Custom", type the base b. Any positive number except 1 works. Common choices outside the presets: log₃ for ternary, log₁₆ for hex digits.
The summary card shows log_b(x) in your chosen base. Stat tiles show all three standard bases — useful for cross-checking when a textbook asks for one specifically.
The chart shows y = log_b(x) with your point marked. Note how the curve rises steeply near x = 0 and then flattens — logs grow slowly.
The formula card shows the change-of-base arithmetic and verifies b^y = x — exactly the steps you would write out in a homework solution.
Reference
These are the values people look up most often. Powers of the base always give whole-number answers: log 1,000,000 = 6 because 10⁶ = 1,000,000, and log₂ 1024 = 10 because 2¹⁰ = 1024. Every other input gives an irrational decimal, shown here to six places.
| x | log₁₀(x) | x | log₁₀(x) |
|---|---|---|---|
| 1 | 0 | 10 | 1 |
| 2 | 0.301030 | 100 | 2 |
| 2.5 | 0.397940 | 1,000 | 3 |
| 3 | 0.477121 | 10,000 | 4 |
| 5 | 0.698970 | 1,000,000 | 6 |
| 0.1 | −1 | 10,000,000 | 7 |
| Expression | Value | Expression | Value |
|---|---|---|---|
| ln 1 | 0 | log₂ 2 | 1 |
| ln 2 | 0.693147 | log₂ 8 | 3 |
| ln e | 1 | log₂ 16 | 4 |
| ln 10 | 2.302585 | log₂ 32 | 5 |
| log₃ 81 | 4 | log₂ 10 | 3.321928 |
Decibel example: expressions like 20 log 3 come from signal gain in dB. log₁₀ 3 = 0.477121, so 20 × 0.477121 = 9.542 dB.
Logarithms undo exponents. To go the other way, use the exponent calculator. For very large or very small numbers, the scientific notation calculator shows the power of ten directly. For a full keypad, open the scientific calculator.
Everything you need to know about logarithms — bases, identities, and where they appear.
A logarithm answers the question "what power do I raise the base to in order to get this number?". log_b(x) = y means b^y = x. So log₁₀(1000) = 3 because 10³ = 1000, and log₂(32) = 5 because 2⁵ = 32. Logs are the inverse of exponentials.
By convention, log (with no base shown) means log₁₀ in engineering and elementary maths, and ln means the natural logarithm with base e ≈ 2.71828. In pure mathematics and physics, "log" sometimes means ln — so always check context. In computer science, "log" often means log₂. This calculator shows all three together to avoid ambiguity.
To compute log_b(x) using only logs your calculator natively supports (typically log₁₀ and ln): log_b(x) = log_k(x) / log_k(b) for any valid base k. Using ln: log_b(x) = ln(x) / ln(b). This is how this tool computes custom-base logs internally.
No — the real logarithm log_b(x) is only defined for x > 0. As x → 0⁺, log x → −∞; the log of zero or any negative number is undefined in the real numbers. Complex logarithms extend the definition (log(−1) = iπ for ln) but most calculators, including this one, work in the reals.
log_b(1) = 0 for every valid base b, because b⁰ = 1. Similarly log_b(b) = 1 (since b¹ = b), and log_b(b^n) = n. These three identities — log(1) = 0, log(b) = 1, log(b^n) = n — are the easiest sanity checks when working with logs.
The base e ≈ 2.71828 is "natural" because the derivative of ln(x) is simply 1/x — the cleanest derivative of any logarithm. It also arises naturally in continuous growth: anything compounding at rate r over time t becomes e^(rt). Base 10 is a convention from our number system; base 2 from binary; but base e is the one that falls out of calculus.
Almost everywhere quantities span many orders of magnitude. pH = −log₁₀[H⁺] (chemistry). Decibels use 10·log₁₀ of a power ratio (sound, signal). The Richter scale for earthquakes is log₁₀ of seismic wave amplitude (each "magnitude" is 10× larger). Information in bits = log₂(possibilities). Algorithm analysis — binary search runs in O(log n) time. Compound interest doubling time ≈ ln(2)/r.
The three "laws of logs": log(xy) = log x + log y (product rule), log(x/y) = log x − log y (quotient rule), and log(xⁿ) = n · log x (power rule). These are why logs were so useful before calculators — they turn multiplication into addition, division into subtraction, and powers into multiplication.
Most logs are irrational and have non-terminating decimal expansions — for example log₁₀(2) ≈ 0.30103…. Only special inputs (like x being a power of b) give integer or clean rational answers. The calculator reports 4–8 decimal places, accurate to IEEE 754 double precision.
They are inverse functions: log_b(b^x) = x and b^(log_b x) = x. Graphically, y = log_b(x) is the reflection of y = b^x across the line y = x. Anywhere you see a log, you can rewrite it as an exponential, and vice versa — useful when solving equations involving either.
Yes — any positive b ≠ 1 is a valid base. For 0 < b < 1, log_b(x) is a decreasing function: log_b(1) = 0, but log_b(x) becomes negative for x > 1. The case b = 1 is excluded because 1^y = 1 for all y, so log₁ has no inverse.
Calculations use JavaScript's Math.log / Math.log10 / Math.log2, which are implemented in IEEE 754 double precision — accurate to about 15–17 significant digits. For typical use this is far more precision than any physical measurement could justify. For arbitrary-precision computation you would need a big-decimal library.
Every calculation runs in your browser with standard double-precision arithmetic, and each result is checked against worked examples before we publish. Nothing you type is sent to our servers.
Spotted an error or out-of-date figure? Tell us. We review every report and correct confirmed mistakes promptly.