Logarithm Calculator
Compute log base 10, natural log (ln) and the log of any base
Last updated October 2026
Method: Base 10, base e and base 2 use the built-in logarithm functions; any other base uses the change-of-base identity logb(x) = ln(x) ÷ ln(b) (NIST DLMF equation 4.2.8). When the base raised to a whole number gives x exactly, the result is shown as that whole number. Logarithms are defined only for x > 0 and a base b > 0 with b ≠ 1; other inputs return a clear message instead of a wrong number.
Included: Common log (base 10), natural log (ln, base e), binary log (base 2), the log of any custom base (type e for the natural-log base), step-by-step working, a reverse check, results to 10 significant figures with scientific notation for very small or large values, and the product, quotient, power and change-of-base rules.
Not included: Complex logarithms of negative numbers, multi-valued (complex) results, and symbolic algebra. Results are computed in double precision (about 15 to 16 significant digits).
📐 Logarithm inputs
Type the letter e for the natural-log base (e ≈ 2.718281828).
🔢 log10(1000)
🧮 Step by step (change of base)
📋 logb(1000) for common bases
| Base b | Notation | Result |
|---|---|---|
| 2 | log₂(x) | 9.965784285 |
| e | ln(x) | 6.907755279 |
| 10 | log₁₀(x) | 3 |
📘 The logarithm rules
logb(x · y) = logb(x) + logb(y)The log of a product is the sum of the logs.
logb(x ÷ y) = logb(x) − logb(y)The log of a quotient is the difference of the logs.
logb(xk) = k · logb(x)An exponent inside the log comes out as a factor.
logb(x) = ln(x) ÷ ln(b) = log10(x) ÷ log10(b)This is the rule this calculator uses for any base other than 2, e or 10.
Logarithm calculator: everything you need to know
A logarithm answers one question: to what power must you raise the base to get a number? For example, log10(1000) = 3, because 10 × 10 × 10 = 1,000. This logarithm calculator (or log calculator) computes log base 10, natural log (ln, base e), binary log (base 2), or any custom base instantly, using the change-of-base formula where needed, and shows every step.
The definition and the formula
Formally, the logarithm is the inverse of exponentiation. The statement on the left below means exactly the same thing as the statement on the right:
logb(x) = y ⇔ by = x To evaluate a log in any base, the calculator uses the change-of-base formula, which rewrites the log in terms of natural logarithms (or base-10 logs) that a computer can compute directly:
logb(x) = ln(x) ÷ ln(b) Here x is the value (it must be greater than 0), b is the base (it must be greater than 0 and not equal to 1), and ln is the natural logarithm, log base e, where e ≈ 2.71828.
A worked example
Suppose you want log2(50): "how many times must I double to reach 50?" Plug into change of base: ln(50) ≈ 3.91202 and ln(2) ≈ 0.69315, so log2(50) = 3.91202 ÷ 0.69315 ≈ 5.6439. That makes sense: 25 = 32 (too small) and 26 = 64 (too big), so the answer sits between 5 and 6. To check, raise the base back to the result: 25.6439 ≈ 50. The reverse calculation returning your original value is the proof that the logarithm is correct.
How to use this logarithm calculator
- Enter the value (x). This is the number you want the logarithm of. It must be positive, because logarithms of zero or negative numbers are undefined in the real numbers. E-notation such as 2.5e-7 and the letter e both work.
- Enter the base (b). The default is 10 (the common log). Use the quick buttons for base 2, base 10, or base e, or type any positive base except 1.
- Read the result instantly. The big number is logb(x) for your chosen base. Below it you always get the common log, natural log, and binary log of the same value side by side.
- Follow the steps. The "step by step" card shows ln(x), ln(b), and their quotient, then verifies the answer by raising the base back to the result.
Everything recalculates as you type; there is no submit button to press.
Common log, natural log and binary log
Three bases come up far more than any other, so the calculator always shows all three:
- Common logarithm, log10. Often written just "log". It underpins scientific notation, the decibel scale, earthquake magnitudes, and pH in chemistry. log10(1000) = 3 simply counts the zeros.
- Natural logarithm, ln = loge. The default of calculus and continuous growth. ln(e) = 1, and the derivative of ln(x) is 1/x.
- Binary logarithm, log2. The currency of computer science: it counts doublings, bits, and the depth of binary search.
If you need to multiply or raise these results to a power instead, the Exponent Calculator reverses the operation, and a full Scientific Calculator keeps log, ln, and powers on the same keypad.
The logarithm rules
Three identities turn complicated expressions into simple arithmetic. They are the reason logarithms were invented: they convert multiplication into addition.
- Product rule: logb(x · y) = logb(x) + logb(y). Example: log10(100) = log10(10 · 10) = 1 + 1 = 2.
- Quotient rule: logb(x ÷ y) = logb(x) − logb(y). Example: log2(8/2) = log2(8) − log2(2) = 3 − 1 = 2.
- Power rule: logb(xk) = k · logb(x). Example: log10(1000) = log10(103) = 3 · 1 = 3.
Two anchor identities follow directly from the definition: logb(1) = 0 (any base to the power 0 is 1) and logb(b) = 1 (the base to the first power is itself).
Log base 3 of 9, base 2 of 8: change-of-base examples
These are the "log base b of x" problems that show up in homework. Each row applies logb(x) = ln(x) ÷ ln(b); the clean whole-number results happen when x is an exact power of the base.
| Expression | ln(x) | ln(b) | Result |
|---|---|---|---|
| log2(8) | 2.07944 | 0.69315 | 3 |
| log3(9) | 2.19722 | 1.09861 | 2 |
| log3(27) | 3.29584 | 1.09861 | 3 |
| log4(64) | 4.15888 | 1.38629 | 3 |
| log5(25) | 3.21888 | 1.60944 | 2 |
| log2(1024) | 6.93147 | 0.69315 | 10 |
| log2(70) | 4.24850 | 0.69315 | 6.12928 |
| log10(1000000) | 13.81551 | 2.30259 | 6 |
Key terms explained
- Base (b): the number being repeatedly multiplied. Logarithms "ask" how many of these multiplications are needed.
- Argument (x): the value inside the log, the target you are trying to reach. It must be positive.
- e: Euler's number, ≈ 2.71828, the base of the natural logarithm and continuous growth.
- Mantissa & characteristic: the fractional and integer parts of a base-10 log. In log10(500) ≈ 2.699, the characteristic 2 tells you the number has 3 digits.
- Antilogarithm: the inverse operation, raising the base to a log value to recover x: b(logb x) = x.
More worked examples
Example 1: common log of a non-round number. log10(500) = ln(500) ÷ ln(10) = 6.21461 ÷ 2.30259 ≈ 2.6990. The "2" says 500 has three digits; the ".699" places it between 100 (log 2) and 1000 (log 3).
Example 2: natural log in growth. If an investment grows continuously and you want to know the time to double, you solve ert = 2, giving t = ln(2) ÷ r. Since ln(2) ≈ 0.6931, at a 5% continuous rate the doubling time is 0.6931 ÷ 0.05 ≈ 13.9 years, the math behind the "rule of 70".
Example 3: a fractional base. log0.5(8) = ln(8) ÷ ln(0.5) = 2.07944 ÷ (−0.69315) = −3. A base below 1 gives a decreasing log, so the result is negative: you must halve three times to go from 8 down to 1.
What is log(1000000), ln(100) and log2(70)?
These are the exact numbers people most often type. This matrix gives the common log (base 10), natural log (ln), and binary log (base 2) side by side, rounded to five decimal places, so you can read any of them at a glance.
| x | log10(x) | ln(x) | log2(x) |
|---|---|---|---|
| 2 | 0.30103 | 0.69315 | 1 |
| 10 | 1 | 2.30259 | 3.32193 |
| 70 | 1.84510 | 4.24850 | 6.12928 |
| 100 | 2 | 4.60517 | 6.64386 |
| 1,000 | 3 | 6.90776 | 9.96578 |
| 1,000,000 | 6 | 13.81551 | 19.93157 |
log2(70) step by step
When x is not an exact power of the base, follow the change-of-base steps below. The final row shows the reverse check: raising the base back to the result must return x (here it lands a hair under 70 only because the exponent was rounded to five decimals; the calculator's full-precision check gives 70).
| Step | Value |
|---|---|
| 1. Take ln of x = 70 | ln(70) = 4.24850 |
| 2. Take ln of base b = 2 | ln(2) = 0.69315 |
| 3. Divide: 4.24850 ÷ 0.69315 | 6.12928 |
| 4. Sanity range (26=64, 27=128) | between 6 and 7 |
| 5. Reverse check: 26.12928 | 69.99985 ≈ 70 |
Quick reference table
Some logarithm values are worth recognizing on sight. Notice how log10 of a power of ten is just the number of zeros.
| x | log10(x) | ln(x) | log2(x) |
|---|---|---|---|
| 1 | 0 | 0 | 0 |
| 2 | 0.30103 | 0.69315 | 1 |
| e ≈ 2.71828 | 0.43429 | 1 | 1.44270 |
| 8 | 0.90309 | 2.07944 | 3 |
| 10 | 1 | 2.30259 | 3.32193 |
| 100 | 2 | 4.60517 | 6.64386 |
| 1000 | 3 | 6.90776 | 9.96578 |
Who this calculator is for
- Students checking algebra, pre-calculus, or calculus homework and learning the change-of-base method (expressing the solution of an exponential equation as a logarithm is a high-school Common Core standard).
- Computer-science learners who need log2 for algorithm complexity, bits, or tree depth.
- Scientists and engineers working with decibels, pH, earthquake magnitudes, or half-life and decay.
- Finance and data folks using natural logs for continuous growth, log returns, and log-scale charts.
- Anyone who just needs a quick, trustworthy log of a number in a specific base.
Where logarithms show up in the real world
Logarithms compress huge ranges into manageable scales. Earthquake magnitude and acidity (pH) are base-10 logarithmic: the U.S. Geological Survey explains that each whole-number step in magnitude is a tenfold increase in measured amplitude, and each whole pH unit is a tenfold change in acidity. Sound levels in decibels use ten times the base-10 logarithm of an intensity ratio, so every 10 dB is a tenfold change in intensity. In finance, "log returns" use the natural log because they add up neatly over time. In computing, log2 describes how many comparisons a binary search needs. And the slide rule, the engineer's tool for centuries, worked purely by turning multiplication into the addition of logarithmic distances.
Tips for working with logarithms
- Estimate first. For log10, count digits: a 4-digit number has a log between 3 and 4. This catches typos instantly.
- Memorize log10(2) ≈ 0.301 and log10(3) ≈ 0.477. With the product and power rules you can mentally approximate many other logs.
- Use ln(2) ≈ 0.693 for doubling-time problems; it powers the rule of 70/72.
- Remember the inverse. If a log result looks off, exponentiate it; the base raised to the answer should return your original number.
Solving exponential equations with logarithms
The single most common reason to reach for a logarithm in algebra is to get a variable down out of an exponent. Suppose you need to solve 3x = 81. Take the log of both sides and apply the power rule: log(3x) = log(81), so x · log(3) = log(81), which gives x = log(81) ÷ log(3) = 4. The base you choose does not matter (common log, natural log, or log base 3 all return the same x) because the change-of-base ratio cancels out. This is the everyday workhorse use of the change-of-base formula, and it is why "isolate the exponential, then take logs" is a standard recipe in any pre-calculus course.
A subtler case is when the unknown appears in the base instead, as in x3 = 81. That one is a root, not a logarithm, so you would undo it with the root operation rather than a log. The quick test: if the unknown is the power, use a logarithm; if the unknown is the base, use a root or exponent.
Graphing and the shape of a logarithm
Plotting y = logb(x) reveals why logarithms behave the way they do. Every logarithmic curve passes through the point (1, 0), because logb(1) = 0 for any base. For a base greater than 1 the curve rises, slowly and ever more gently as x grows, and dives steeply toward negative infinity as x approaches 0 from the right. The vertical line x = 0 is a vertical asymptote the graph never crosses, which is the visual statement that the log of zero is undefined. A larger base produces a flatter curve, and a base between 0 and 1 mirrors the graph downward so the function decreases. Because the logarithm is the inverse of the exponential, its graph is the reflection of y = bx across the line y = x: the domain and range simply swap, which is why exponentials accept any x but only output positives, while logarithms accept only positive x but output any real number.
A short history: why logarithms were invented
John Napier published the first table of logarithms in 1614, and Henry Briggs reworked them to base 10 a few years later. Their goal was purely practical: before electronic computing, multiplying or dividing large numbers by hand was slow and error-prone. By converting a multiplication into the addition of two table look-ups (the product rule), and a power into a single multiplication (the power rule), logarithms turned hours of arithmetic into minutes. That same idea powered the slide rule, the engineer's constant companion for three centuries, which simply lined up logarithmic distances so that sliding one scale against another physically "added" the logs. Today the arithmetic motivation is gone, but the structural insight, that logarithms convert multiplicative relationships into additive ones, is exactly why they remain everywhere in science, finance, and computing.
Related concepts and calculators
Logarithms sit inside a small family of operations. If your question is slightly different, a sister tool fits better:
- To go the other way and raise a number to a power, use the Exponent Calculator; it is the exact inverse of taking a log.
- For square and other roots, the Square Root Calculator handles the radical case.
- For a full keypad with sin, cos, log and ln buttons, use the Scientific Calculator.
- To write very large or very small results in powers-of-ten form, the Scientific Notation Calculator pairs naturally with base-10 logs.
- For percentages, growth rates, and everyday math, see the Percentage Calculator and Average Calculator.
Logarithms are the tool for solving exponential models. The Exponential Growth Calculator uses the natural log to find how long a quantity takes to grow by a given factor, and the Half-Life Calculator runs the same math in reverse for decay.
Sources & further reading
- NIST Digital Library of Mathematical Functions: §4.2 Logarithm definitions (change of base, equations 4.2.8 and 4.2.9, and log10, equation 4.2.15).
- NIST DLMF: §4.6 Power series for the logarithm.
- Common Core State Standards: HSF-LE.A.4 (express the solution of an exponential model as a logarithm with base 2, 10 or e).
- U.S. Geological Survey: Earthquake magnitude, energy release, and shaking intensity and pH and water (logarithmic scales).
- Napier, J. (1614), Mirifici Logarithmorum Canonis Descriptio, the first published table of logarithms.
⚠️ Common mistakes & edge cases
Taking the log of zero or a negative number
log(0) and log of any negative value are undefined in the real numbers, because a positive base can never be raised to a power that yields zero or a negative result. As x → 0⁺, log(x) heads to −∞. The calculator flags these inputs instead of guessing.
Confusing "log" (base 10) with "ln" (base e)
On most calculators "log" means base 10 and "ln" means base e. Using the wrong one is a classic error: log10(100) = 2 but ln(100) ≈ 4.605. Always confirm which base your problem expects.
Misapplying the rules to sums
log(x + y) is not log(x) + log(y). The product rule applies to multiplication, not addition. There is no simple rule for the log of a sum, and that mix-up is one of the most common algebra slips.
Using a base of 1 (or 0)
The base cannot be 1, because 1 raised to any power is always 1 and can never reach a different x, so log base 1 is undefined. The base also cannot be 0 or negative. A positive fraction like 0.5 is fine and produces a decreasing (often negative) logarithm.
❓ Frequently asked questions
How do I calculate a logarithm with any base?
Use the change-of-base formula: log_b(x) = ln(x) / ln(b), where ln is the natural logarithm (base e). You can also use log base 10: log_b(x) = log10(x) / log10(b). This calculator uses the built-in log10, ln and log2 functions for those three bases and the change-of-base rule for any other positive base (other than 1), so you get a result accurate to about 15 significant digits, shown to 10.
What is the difference between log and ln?
By convention, 'log' written without a base usually means the common logarithm, log base 10. 'ln' is the natural logarithm, which is log base e (where e is approximately 2.71828). On most calculators the 'log' button is base 10 and the 'ln' button is base e. In higher mathematics and computer science, 'log' sometimes means base e or base 2, so always check the context.
Why is the logarithm of a negative number or zero undefined?
A logarithm answers the question 'to what power must the base be raised to get x?'. A positive base raised to any real power is always positive, so it can never equal zero or a negative number. As x approaches 0 from above, log(x) tends to negative infinity, and for x at or below 0 the real logarithm simply does not exist. That is why this calculator only accepts values greater than 0.
What is the natural logarithm (ln) used for?
The natural logarithm, ln(x) = log base e, appears anywhere continuous growth or decay occurs: compound interest, population models, radioactive decay, and the calculus of exponential functions. Its key property is that the derivative of ln(x) is 1/x, which makes it the natural choice in calculus and in solving equations of the form e^x = y, where x = ln(y).
What are the three main logarithm rules?
The product rule: log_b(x·y) = log_b(x) + log_b(y). The quotient rule: log_b(x/y) = log_b(x) − log_b(y). The power rule: log_b(x^k) = k·log_b(x). Together they let you expand or condense logarithmic expressions and turn multiplication and exponents into addition and multiplication, which is what made log tables so useful before electronic calculators.
What does log base 2 (the binary logarithm) mean?
log base 2 of x answers 'how many times must I double to reach x?'. log2(8) = 3 because 2×2×2 = 8. The binary logarithm is central to computer science: it measures the number of bits needed to represent a number and describes the running time of algorithms such as binary search and balanced-tree operations, which are O(log n) in base 2.
How do I check a logarithm answer?
Exponentiate. If log_b(x) = y, then b raised to the power y should give back x. For example, log10(1000) = 3, and 10^3 = 1000, which confirms it. This calculator shows that check automatically: it raises your base to the computed result and shows that it returns x.
Can the base of a logarithm be 1 or a fraction?
The base cannot be 1, because 1 raised to any power is always 1, so it can never equal a different value of x; log base 1 is undefined. The base can be a positive fraction such as 0.5, though. A base between 0 and 1 gives a decreasing logarithm: as x grows, log_0.5(x) becomes more negative. This calculator accepts any positive base except 1, and you can type the letter e for the natural-log base.
What is the logarithm of 1, and of the base itself?
log_b(1) = 0 for every valid base, because any non-zero number raised to the power 0 equals 1. And log_b(b) = 1, because the base raised to the first power is itself. These two identities are handy anchors: log10(1) = 0, ln(1) = 0, log2(2) = 1, and log10(10) = 1.
Are logarithms and exponents inverses of each other?
Yes. The logarithm is the inverse of exponentiation. If b^y = x, then log_b(x) = y, and vice versa. This is why log_b(b^k) = k and b^(log_b(x)) = x. Anytime you need to 'undo' an exponent and solve for the power, a logarithm is the tool, which is the basis for solving exponential equations.
How do I use a logarithm to solve an exponential equation?
Isolate the exponential term, then take the log of both sides and use the power rule. For example, to solve 3^x = 81: log(3^x) = log(81), so x·log(3) = log(81), giving x = log(81) / log(3) = 4. The base you take the log in does not matter (common log, natural log, or any other base all give the same answer), because the change-of-base ratio cancels. If the unknown is the base rather than the exponent (like x^3 = 81), use a root instead of a logarithm.
What does the graph of a logarithm look like?
The graph of y = log_b(x) always passes through (1, 0) because log_b(1) = 0. For a base greater than 1 it rises slowly and flattens as x grows, and it drops steeply toward negative infinity as x approaches 0 from the right. The line x = 0 is a vertical asymptote the curve never crosses, which is the visual reason the log of zero is undefined. The logarithm graph is the mirror image of the exponential graph y = b^x reflected across the line y = x, since the two functions are inverses.
What is log of 1,000,000?
The common logarithm log10(1,000,000) = 6, because 1,000,000 = 10^6: the base-10 log of a power of ten just counts the zeros. In other bases the same value is ln(1,000,000) ≈ 13.81551 (natural log) and log2(1,000,000) ≈ 19.93157 (binary log).
How do I calculate log base 3 of 9?
log base 3 of 9 = 2, because 3^2 = 9. Using change of base, log_3(9) = ln(9) / ln(3) = 2.19722 / 1.09861 = 2. Whenever the argument is an exact power of the base, such as 9 = 3^2, the logarithm is a whole number, here the exponent 2.
Why do I see a result like 4.342942647 × 10⁻⁷?
That is a very small logarithm written in scientific notation. The log of a number very close to 1 is very close to 0: log10(1.000001) is about 0.0000004343. Rather than rounding it to 0, the calculator switches to scientific notation for results smaller than 0.000001 or larger than 10^15, so every result keeps 10 significant figures.
💡 Good to know
Logarithms turn multiplication into addition
That single property is why they were invented in the 1600s and why slide rules worked. The product rule, log(x·y) = log(x) + log(y), let people multiply large numbers by adding their logs from a table.
The base matters: state it clearly
"log" can mean base 10, base e, or base 2 depending on the field. In advanced math it often means ln; in engineering, base 10; in computer science, base 2. When in doubt, write the base explicitly as logb.
Change of base unlocks every base
Your physical calculator may only have "log" and "ln" buttons, but with logb(x) = ln(x) ÷ ln(b) you can compute a log in any base from those two. This tool does it for you automatically.
Related Calculators
Exponent Calculator
Raise numbers to any power
Scientific Calculator
A full scientific calculator with trig, logs and more
Square Root Calculator
Find the square root of any number
Scientific Notation Calculator
Convert numbers to and from scientific notation
Exponential Growth Calculator
Exponential growth and decay, rate and doubling time
Half-Life Calculator
Radioactive decay: remaining amount, time or half-life
Radical Calculator
Simplify square roots and radicals into simplest form
Complex Number Calculator
Add, multiply, divide, convert and find roots of complex numbers