What is a logarithm?
A logarithm is the power a base must be raised to in order to produce a given number. Ten raised to the power 3 is 1000, so the logarithm of 1000 in base 10 is 3. In symbols, logb(x) = y means exactly by = x. A log calculator answers that question for any base you choose, and an antilog calculator runs it backwards: give it the power and it returns the number. The two operations are inverses, like squaring and square roots, and this page provides both in one place.
Three names cover almost every logarithm you will meet. The common logarithm uses base 10 and is written log10 or simply log. The natural logarithm uses base e, where e is approximately 2.718282, and is written ln. The binary logarithm uses base 2 and is written log2. They are the same function with a different base selected, which is why this tool treats the base as an input with presets for 10, 2 and e.
Two domain rules frame everything else. The value x must be positive: no power of a positive base can produce zero or a negative number, so the logarithm of zero and of negative numbers is undefined in real numbers, and this page says so plainly instead of printing a made-up value. The base b must be positive and cannot equal 1, because 1 raised to any power is always 1. The calculator enforces both rules with clear messages.
How this log calculator works
The engine behind the page is one formula: the change-of-base formula, logb(x) = ln(x) / ln(b). Your browser computes the two natural logarithms in double-precision floating point and divides them, and the result panel prints both ln values and their quotient, so the working is never hidden. That transparency matters for learning how to calculate log values by hand: any basic calculator with only an ln button can reproduce every result on this page by following the same two divisions.
The quick panel answers the two most common follow-up questions automatically: whatever x you enter in Log mode, it shows ln(x) and log10(x) beside the main result, with no re-typing. Decimal places run from 2 to 10 — 2 places are plenty for a pH estimate, while 8 or 10 suit checking coursework. Nothing is uploaded; the arithmetic happens in your browser tab.
How to calculate log: the change-of-base formula, step by step
Most calculators offer only two logarithm buttons, log (base 10) and ln (base e), yet school and work problems ask for log base 2, log base 5 and every other base. The change-of-base formula is the bridge: logb(x) = ln(x) / ln(b). It works because logarithms in different bases are all proportional to each other; dividing by ln(b) simply rescales the natural log into the base you want. The same formula with base 10 on top and bottom, log10(x) / log10(b), gives identical results.
Worked example — log2(32). Take natural logs: ln(32) = 3.465736 and ln(2) = 0.693147. Divide: 3.465736 / 0.693147 = 5.000000. The answer is exactly 5, and the definition confirms it: 25 = 32. Whenever the answer is a whole number, the division lands on it cleanly, which is a reliable sign the working is right.
Worked example — log5(125). ln(125) = 4.828314 and ln(5) = 1.609438. Dividing gives exactly 3, matching 53 = 125. Worked example — log10(1000). Here the base is already 10, so the answer is the familiar 3, because 103 = 1000. Notice the pattern across all three examples: when x is an exact power of the base, the logarithm is that exponent, whole and clean. When it is not, the logarithm falls between two whole numbers, and the change-of-base division finds exactly where.
Before dividing, bracket the answer: log2(50) must lie between log2(32) = 5 and log2(64) = 6, and the calculator returns 5.643856, inside the bracket. Any result outside its bracket is wrong, full stop. Bracketing first and dividing second is the complete hand method for how to calculate log values in any base.
Log rules: product, quotient, power and change of base
Each rule is the exponent laws read in a mirror. Because adding exponents multiplies powers, the log of a product is a sum of logs. Because the power rule (by)n = byn multiplies exponents, the log of a power pulls the exponent down as a multiplier. The table states each rule with a numeric check in base 10 that you can verify in the calculator above.
| Rule | Formula | Example (base 10) | Check |
|---|---|---|---|
| Product rule | log(xy) = log(x) + log(y) | log10(100 × 1000) | 2 + 3 = 5, and log10(100000) = 5 |
| Quotient rule | log(x/y) = log(x) − log(y) | log10(1000 / 100) | 3 − 2 = 1, and log10(10) = 1 |
| Power rule | log(xn) = n · log(x) | log10(104) | 4 × log10(10) = 4 × 1 = 4 |
| Change of base | logb(x) = ln(x) / ln(b) | log2(32) | 3.465736 / 0.693147 = 5 |
| Log of the base | logb(b) = 1 | log10(10), ln(e), log2(2) | All equal 1, since b1 = b |
| Log of 1 | logb(1) = 0 | log10(1), ln(1), log2(1) | All equal 0, since b0 = 1 |
| Inverse (antilog) | blogb(x) = x | 10log10(316.2278) | = 316.2278, the starting number |
The power rule is the reason logarithms were invented: it converts exponentiation into multiplication, and the product rule converts multiplication into addition. Every slide rule, log table and decibel chart is those two conversions at work. Note the condition: the rules apply to positive values only, because the logarithms of zero and negative numbers do not exist in the reals.
Common, natural and binary logarithms: log10, ln and log2
The common logarithm, log10, matches our base-10 counting system, which makes it a natural order-of-magnitude meter: log10(5230) ≈ 3.72 tells you immediately that 5230 lies between 103 and 104. It is the logarithm of decibels, pH and the Richter scale, and the one meant when a school problem or a calculator key says plain log. The base 10 preset on this page is the fastest route to it.
The natural logarithm, ln, uses base e ≈ 2.718282, the constant of continuous growth. Its convenience appears in calculus: the derivative of ln(x) is exactly 1/x, with no correction factor. Growth and decay therefore speak ln natively: a quantity growing continuously at rate r doubles every ln(2)/r time units, and ln(2) ≈ 0.693147 is the doubling constant behind the rule of 70. The quick panel shows ln(x) for every x you enter.
The binary logarithm, log2, counts doublings: how many times 2 must be multiplied by itself to reach x. It measures information in bits and the depth of a binary search — log2 of a million items is about 20 steps. Its landmarks are whole numbers at powers of two: log2(8) = 3, log2(32) = 5, log2(1024) = 10. The three logarithms are proportional — ln(x) = log10(x) × 2.302585 — so converting between them is one multiplication.
Common logarithm values table
The table below collects the values students and practitioners look up most, each computed with this page's own method so you can reproduce every row above. Read it in both directions: across a row to convert between bases, and down the log2 column to see the doubling landmarks.
| x | log10(x) | ln(x) | log2(x) | Note |
|---|---|---|---|---|
| 1 | 0 | 0 | 0 | Log of 1 is 0 in every base |
| 2 | 0.301030 | 0.693147 | 1 | ln(2) is the doubling constant |
| e ≈ 2.718282 | 0.434294 | 1 | 1.442695 | ln(e) = 1 by definition |
| 5 | 0.698970 | 1.609438 | 2.321928 | log10(5) = 1 − log10(2) |
| 10 | 1 | 2.302585 | 3.321928 | ln(10) converts ln to log10 |
| 32 | 1.505150 | 3.465736 | 5 | 25 = 32 |
| 100 | 2 | 4.605170 | 6.643856 | 102 = 100 |
| 125 | 2.096910 | 4.828314 | 6.965784 | 53 = 125, so log5(125) = 3 |
| 1000 | 3 | 6.907755 | 9.965784 | 103 = 1000 |
| 1024 | 3.010300 | 6.931472 | 10 | 210 = 1024 |
Two rows reward a second look. The row for x = 10 contains the conversion constant ln(10) = 2.302585: divide any natural log by it to get log10. The row for x = 2 contains ln(2) = 0.693147, the divisor in every log base 2 calculation. With those two constants and the change-of-base formula, the whole table can be rebuilt from a single ln button.
Antilog: undoing a logarithm
Every logarithm statement has an antilog reading. log10(1000) = 3 and the antilog of 3 in base 10 is 103 = 1000 are the same fact read in opposite directions. Antilog work appears whenever a scale hands you the compressed number and you need the real quantity back: converting a pH of 4.5 into a hydrogen ion concentration of 10−4.5, turning a decibel figure back into an intensity ratio, or recovering a balance from a continuously compounded growth calculation in base e.
The Antilog mode raises the base to your exponent in double precision, then proves its own answer by applying the log straight back. Fractional exponents are welcome — 102.5 = 316.227766, displayed as 316.2278 at four decimal places — and so are negative exponents, which produce fractions: 10−2 = 0.01 and 2−3 = 0.125.
Logarithm and antilog examples at a glance
| Question | Working | Answer | Check |
|---|---|---|---|
| log2(32) | ln(32) / ln(2) = 3.465736 / 0.693147 | 5 | 25 = 32 |
| log10(1000) | Base 10 directly | 3 | 103 = 1000 |
| ln(20.085537) | Natural log, base e | ≈ 3 | e3 = 20.085537 |
| log5(125) | ln(125) / ln(5) = 4.828314 / 1.609438 | 3 | 53 = 125 |
| Antilog 102.5 | Raise 10 to 2.5 | 316.2278 | log10(316.2278) = 2.5 |
| Antilog base 2 of 10 | Raise 2 to 10 | 1024 | log2(1024) = 10 |
| log10(0.01) | Base 10 directly | −2 | 10−2 = 0.01 |
| ln(1) | Any base | 0 | e0 = 1 |
Read the table as the calculator's contract: exact powers come back as exact whole numbers, the change-of-base working is printed for every non-standard base, antilogs are verified by logging them straight back, and inputs with no real answer, such as log of 0, are refused with an explanation rather than dressed up as numbers. Every row can be checked by the inverse operation, which is the habit this page is designed to teach.
Logarithms in real life: sound, earthquakes, acidity and growth
Sound. The decibel scale is log10 applied to intensity ratios: a sound ten times as intense measures 10 decibels higher, a hundred times as intense only 20 higher. Without the logarithm, everyday sound would span numbers from 1 to over a trillion; with it, the range fits between 0 and about 140. Earthquakes use the same compression: each whole magnitude step is roughly 32 times the energy of the previous step, so a magnitude 7 quake releases about a thousand times the energy of a magnitude 5.
Chemistry. pH is the negative log10 of hydrogen ion concentration, which is why a pH 2 solution is ten times as acidic as pH 3. The antilog direction is the working direction in the lab: a measured pH becomes a concentration through 10−pH. Growth and decay belong to ln: half-life, cooling and continuously compounded interest are exponential processes, and taking ln of both sides is the standard first step in solving for time. Computing runs on log2: searching a sorted list of a billion entries takes at most about 30 comparisons, since log2(109) ≈ 29.9.
Common logarithm mistakes
Logging a sum as a sum of logs. log(10 + 100) is log(110) ≈ 2.041393, not log(10) + log(100) = 3. The product rule applies to products only; there is no rule that splits a sum inside a logarithm, and inventing one is the single most common algebra error with logs.
Dividing the numbers instead of the logs. log2(32) is not 32 / 2 = 16. Change of base divides ln(32) by ln(2) — the logarithms of the numbers, never the numbers themselves. The calculator prints both ln values precisely so this step cannot be skipped or fudged.
Assuming log means the same base everywhere. On a school calculator log is base 10, in a programming library log is usually base e, and in information theory it is base 2. The same keystrokes can legitimately produce 3, 6.907755 or 9.965784 for the input 1000. Always state the base; this page labels it on every result.
Trying to take the log of zero or a negative. There is no real answer, and a tool that prints one, or a silent NaN, is failing you. The correct statements are: logb(0) is undefined, and logb of a negative number is undefined in real numbers. If an equation leads you there, the equation has no real solution at that step.
Rounding mid-calculation. ln(2) rounded to 0.69 before dividing compounds into visible error by the end of a multi-step problem. Keep full precision through the working, as this calculator does internally, and round once, at the end, to the places your answer needs.
Limits: precision, undefined inputs and what this tool does not do
Honest boundaries, stated plainly. Results are floating-point approximations: logarithms are computed by the change-of-base formula in double precision and rounded once for display at the precision you select, from 2 to 10 decimal places. Exact cases, where x is an exact power of the base, come back exact; irrational results are correctly rounded displays of values that never terminate, and the page says so rather than dressing a rounding up as an exact answer. Undefined inputs stay undefined: the log of zero and of negative numbers has no real value, base 1 and non-positive bases are not valid bases, and the calculator explains each refusal instead of returning a number. Very large antilogs overflow: 10400 exceeds the largest double-precision number and is reported as overflow, not as a fabricated figure. Finally, this tool evaluates logarithms and antilogs — it does not solve logarithmic equations symbolically, differentiate, or work in complex numbers, which belong to an algebra course rather than a log calculator. For neighbouring work, the Square Root Calculator handles roots and the Scientific Notation Calculator handles the powers of ten that logarithms measure.
Sources and References
- Khan Academy - Logarithms unit - introduction to logarithms, log properties and the change of base rule
- Wikipedia - Logarithm - definition, bases, identities and history
- Wikipedia - Natural Logarithm - the base-e logarithm, its definition and properties
- NIST Digital Library of Mathematical Functions, Section 4.2 - definitions of the logarithm function
- Wolfram MathWorld - Logarithm - formal definition, identities and special values
- OpenStax, Algebra and Trigonometry 2e, Section 6.3 - Logarithmic Functions
- Wikipedia - Common Logarithm - the base-10 logarithm, its uses and notation
Source note: OpenStax Algebra and Trigonometry 2e, Section 6.4 (logarithmic properties) was considered for this list, but its page returned HTTP 404 to automated retrieval during verification, so Section 6.3 — verified directly with HTTP 200 — is listed in its place. Every source above was verified live before inclusion. Every figure in this guide was calculated with this page's own method, so you can reproduce each one exactly by entering the same numbers above.