Audited 26 May 2026·Last updated 27 Jul 2026·7 citations·Tier 1·0 uses

Logarithm Calculator

Free logarithm calculator: solve log_b(x) for the result, argument, or base. Supports common log, natural log (ln), log base 2, and any custom base.

Logarithm Calculator

What do you want to solve for?
The base of the logarithm. Must be strictly greater than 0 and not equal to 1. Common bases: 10 (common log), e ≈ 2.71828 (natural log, ln), 2 (binary log, lg). Ignored when solving for base.
The value you're taking the logarithm of — what goes inside the parentheses in log_b(x). Must be strictly positive: logarithms of zero or negative real numbers are undefined. Ignored when solving for argument.
The output of the logarithm — the exponent that the base must be raised to in order to produce the argument. Can be any real number including negatives (for arguments between 0 and 1) and zero (for an argument of exactly 1). Ignored when solving for result.
Result (log_b(x))
2
The result of the logarithm — the exponent y such that b^y = x. Computed via the change-of-base formula log_b(x) = ln(x) / ln(b). When solving for argument or base, this echoes back the result you supplied.
Argument (x)
100
Base (b)
10
Natural log of argument (ln(x))
4.6052

Background.

The Quanta logarithm calculator evaluates log_b(x) for any positive argument x and any positive base b ≠ 1, in three directions: enter a base and argument and it returns the result, enter a base and result and it returns the argument (the inverse, also called the antilogarithm), or enter an argument and result and it returns the base that would make the relationship hold. A logarithm is the inverse of exponentiation: if b^y = x, then log_b(x) = y. In plain English, log_b(x) answers the question "what exponent do I need to raise the base b to in order to get x?" That single idea — turning a multiplicative relationship into an additive one, and an exponential into a linear one — is what makes logarithms one of the most important computational tools ever invented.

They were created by John Napier in 1614 specifically to replace tedious multiplications and divisions with additions and subtractions, and for the next three and a half centuries every navigator, astronomer, surveyor, engineer, and physicist on Earth carried log tables or a slide rule (which is just a logarithmic ruler) to do their arithmetic. Logarithms still sit underneath an enormous amount of modern science and everyday life, usually invisibly.

The decibel scale that measures sound intensity is logarithmic — every 10 dB is a 10× increase in power. The pH scale that measures acidity is the negative log base 10 of the hydrogen-ion concentration. The Richter scale for earthquakes, the apparent-magnitude scale for stars, and the f-stop scale on a camera lens are all logarithmic. Information theory measures the information content of a message in bits, which are log base 2 of the number of equally likely possibilities. Computer science measures the runtime of binary search and balanced-tree operations in log time, because each step halves the problem. Chemistry, finance (compound-interest doubling times), epidemiology (exponential growth rates), and machine learning (log-likelihood, cross-entropy loss) all live and breathe natural logarithms.

The three bases you'll meet most often are 10 (the "common" log, written log or log_10, used in engineering and the human-scale scales above), e ≈ 2.71828 (the "natural" log, written ln, used in calculus and continuous-growth models because the derivative of ln(x) is exactly 1/x), and 2 (the "binary" log, written lg or log_2, used in computer science and information theory). The change-of-base formula log_b(x) = ln(x) / ln(b) lets a calculator that only knows one logarithm function compute the log in any other base — and that is exactly what this tool does internally. This page covers the precise definition, the three bases, the inverse operation (exponentiation/antilog), the algebraic identities (product, quotient, power rules), the change-of-base derivation, common pitfalls (negative arguments, base of 1, the difference between log and ln), and a worked example you can step through yourself.

What is logarithm calculator?

A logarithm answers an exponent question. Given a base b > 0 with b ≠ 1, and a positive argument x > 0, the logarithm log_b(x) is the unique real number y such that b^y = x. Symbolically, log_b(x) = y ⟺ b^y = x. The two expressions are exact mirror images of each other — exponentiation and logarithm are inverse functions, which is why the calculator can solve in either direction by simply swapping which variable is unknown. Three bases dominate practice and have their own notations and names. Common logarithm (base 10), written log(x) or log_10(x), was the original "working logarithm" of the slide-rule era and remains the default for engineering scales (decibels, pH, Richter, magnitude) because powers of 10 align with human counting. Natural logarithm (base e), written ln(x) or log_e(x), uses Euler's constant e ≈ 2.718281828… and is the logarithm that falls out of calculus: the derivative of ln(x) is exactly 1/x, the integral of 1/x is ln(x) + C, and any continuous-growth process — compound interest at infinitely small intervals, radioactive decay, population dynamics, drug clearance — produces exponentials of the form e^(kt) whose inverse is ln. Binary logarithm (base 2), written lg(x) or log_2(x), is the logarithm of information theory and computer science: a quantity with N equally likely outcomes carries log_2(N) bits of information, and an algorithm that halves its input each step has log_2(N) steps. The change-of-base identity log_b(x) = log_a(x) / log_a(b) — usually applied with a = e, giving log_b(x) = ln(x) / ln(b) — lets you convert between any two bases with one division, which is what makes a calculator that natively knows only one logarithm able to evaluate them all. Three further identities are used constantly: the product rule log_b(xy) = log_b(x) + log_b(y), the quotient rule log_b(x/y) = log_b(x) − log_b(y), and the power rule log_b(x^p) = p · log_b(x). These three are the reason logarithms were invented: they convert multiplication into addition, division into subtraction, and exponentiation into multiplication, which is what made pre-calculator arithmetic with seven-figure log tables faster than long multiplication by hand.

How to use this calculator.

  1. Pick the mode at the top. "Result" is the default and most common — you know the base and the argument and you want the logarithm itself. "Argument" runs the inverse: you know the base and the log result and you want to recover the original number (the antilog). "Base" is the rarest mode: you know the argument and the result and you want to discover what base satisfies the relationship.
  2. In result mode, enter the base (10 for common log, e ≈ 2.71828 for natural log, 2 for binary log, or any other positive number that isn't 1) and the argument (any positive number). The result log_b(x) updates as you type.
  3. In argument mode, enter the base and the result. The calculator returns b^result — the original number whose logarithm equals that result. This is the "antilog" operation: useful for inverting a decibel reading back to a power ratio, a pH back to a hydrogen-ion concentration, or a log-transformed regression coefficient back to its original scale.
  4. In base mode, enter the argument and the result. The calculator returns x^(1/result) — the base that would make log_b(x) equal your supplied result. Useful when reverse-engineering exponential models from two known data points.
  5. Read the natural log output (ln(x)) as a free cross-check. The identity ln(x) = log_b(x) × ln(b) connects the two, so you can confirm by hand that ln(100) = log_10(100) × ln(10) = 2 × 2.3026 ≈ 4.605.
  6. If you enter a base of 1, a base of 0 or below, or an argument of 0 or below, the calculator will refuse to compute. Logarithms are undefined for those values: log_1 has zero in the denominator of the change-of-base formula, and the logarithm of a non-positive real number doesn't exist as a real number (it only exists as a complex number, which is a different tool).

The formula.

y = log_b(x) ⟺ bʸ = x

The fundamental definition is log_b(x) = y ⟺ b^y = x. Everything else follows from rearranging that single biconditional. The change-of-base formula is log_b(x) = ln(x) / ln(b), and it is how the Quanta engine actually computes any logarithm internally. Derivation: start from b^y = x, take the natural log of both sides to get ln(b^y) = ln(x), apply the power rule on the left to get y · ln(b) = ln(x), and divide by ln(b) (allowed because b ≠ 1, so ln(b) ≠ 0) to obtain y = ln(x) / ln(b). The same derivation works with any other base a ≠ 1 in place of e, giving the general change-of-base log_b(x) = log_a(x) / log_a(b). The inverse relationships are two sides of the same coin: b^(log_b(x)) = x for every positive x, and log_b(b^y) = y for every real y. These are what the "argument" and "base" modes exploit. In argument mode the calculator computes x = b^y = exp(y · ln(b)), using the engine's exp function for numerical stability across very large or very small results. In base mode the calculator solves b^y = x for b by taking the y-th root: b = x^(1/y) = exp(ln(x) / y). Three algebraic identities are used constantly in derivations and worked problems: product rule log_b(xy) = log_b(x) + log_b(y), quotient rule log_b(x/y) = log_b(x) − log_b(y), and power rule log_b(x^p) = p · log_b(x). All three follow directly from the corresponding exponent laws (b^m · b^n = b^(m+n), b^m / b^n = b^(m−n), (b^m)^p = b^(mp)) by taking the logarithm of both sides. Special values worth memorizing: log_b(1) = 0 for any base (because b^0 = 1), log_b(b) = 1 (because b^1 = b), log_b(0) is undefined (b^y can never equal 0 for finite y, only approach it as y → −∞), and log_b of a negative number is undefined over the real numbers. Floating-point note: the engine rounds to fifteen significant figures, which is the practical limit of IEEE 754 double-precision arithmetic, and uses the high-accuracy library implementations of Math.log and Math.exp that ship with V8/Node so cancellation and rounding errors stay below 1 ulp for arguments in the normal floating-point range.

A worked example.

Example

Compute log_10(1000). The base is 10, the argument is 1000. We want the exponent y such that 10^y = 1000. By inspection, 10^3 = 10 × 10 × 10 = 1000, so y = 3. The calculator confirms: result = 3, argument = 1000, base = 10, ln(1000) ≈ 6.9078. We can verify the change-of-base formula by hand: log_10(1000) = ln(1000) / ln(10) = 6.9078 / 2.3026 = 3.000 exactly. The natural log output ln(1000) ≈ 6.9078 also confirms one of the most-used decimal approximations in engineering: ln(10) ≈ 2.3026, so to convert any natural log to a common log you divide by 2.3026 (or multiply by 0.4343 = 1/ln(10)). Two more quick sanity checks using the same calculator: switch the base to 2 and the argument to 8 to get log_2(8) = 3, because 2^3 = 8 — this is the binary log used in information theory, telling you 8 equally likely outcomes carry exactly 3 bits of information. Switch the base to Euler's constant e (enter 2.718281828) and the argument to e itself to get ln(e) = 1, the defining property of the natural logarithm. Finally, switch to argument mode with base 10 and result 3: the calculator returns 1000, recovering the original input — confirming that exponentiation undoes logarithm, exactly as the inverse-function relationship promises.

argument1,000
solve Forresult
base10

Frequently asked questions.

What is the difference between log and ln?
Notation, not concept. "log" without a subscript almost always means log_10 — the common logarithm, base 10 — especially in engineering, chemistry, and the human-scale scales like decibels and pH. "ln" always means log_e — the natural logarithm, base e ≈ 2.71828… — and is the form that appears in calculus, physics, and statistics because the derivative of ln(x) is exactly 1/x and the integral of 1/x is ln(x) + C. The two are related by a single multiplicative constant: ln(x) = log_10(x) × ln(10) ≈ log_10(x) × 2.3026, and conversely log_10(x) = ln(x) / ln(10) ≈ ln(x) × 0.4343. Some pure-mathematics textbooks and most computer-science papers use "log" to mean ln or log_2 instead of log_10, so always check the convention before assuming. In this calculator the base is always explicit, so there is no ambiguity.
What is log base 10 vs log base e?
Log base 10 (log_10, often just written "log") asks "10 to what power equals x?" and is used wherever human-scale orders of magnitude matter: decibels, pH, Richter, star magnitudes, slide rules, the engineer's intuition for "how many digits is this number." Log_10(1) = 0, log_10(10) = 1, log_10(100) = 2, log_10(1000) = 3, and so on. Log base e (log_e, written "ln," the natural logarithm) asks "e to what power equals x?" where e = 2.71828… is Euler's constant. It is used wherever continuous growth or decay appears: compound interest at infinitesimal intervals, radioactive decay, population dynamics, drug clearance, and every differential equation that contains a rate proportional to the current amount. The two are linked by ln(x) = log_10(x) × ln(10) ≈ log_10(x) × 2.3026, so they carry the same information in different units — the same way that a length in centimetres carries the same information as a length in inches.
Why is e (Euler's number) the "natural" base for logarithms?
Because it is the only base where the derivative of the exponential function equals the function itself: d/dx (e^x) = e^x, and consequently d/dx (ln(x)) = 1/x without any extra multiplicative constant. For any other base b, d/dx (b^x) = b^x · ln(b), which carries a ln(b) factor everywhere through calculus. Anywhere a quantity changes at a rate proportional to its current size — bank balance under continuous compounding, a radioactive isotope, a population of bacteria with unlimited food, the voltage across a discharging capacitor — the solution to the governing differential equation dy/dt = ky is y = y_0 · e^(kt). That makes e the base of the universal growth law, and ln (its inverse) the universal de-growth-rate tool. Euler's constant itself can be defined as the limit of (1 + 1/n)^n as n → ∞, which is exactly the amount $1 grows to after one year at 100% annual interest compounded infinitely many times per year — historically the first place e was discovered (Jacob Bernoulli, 1683).
Can you take the logarithm of a negative number?
Not as a real number. The logarithm log_b(x) is defined only for positive arguments x > 0, because for any positive base b > 0 the exponential b^y is always strictly positive for every real exponent y — there is no real number y that makes b^y come out negative or zero. Over the complex numbers, however, logarithms of negative numbers do exist: for example, ln(−1) = iπ (Euler's identity in disguise — e^(iπ) = −1, so by inversion ln(−1) = iπ). The complex logarithm is multi-valued (every complex number has infinitely many logarithms differing by integer multiples of 2πi) and is studied in complex analysis. The Quanta logarithm calculator restricts itself to real-valued arguments and will refuse a non-positive input rather than silently return a complex number; if you need the complex logarithm, that is a different tool.
Why is the logarithm of zero undefined?
Because no finite exponent makes a positive base equal exactly zero. For any base b > 1, b^y approaches zero only as the exponent y → −∞ (so b^(−10) is small, b^(−100) is tinier, but never exactly zero), and for any base 0 < b < 1, b^y approaches zero only as y → +∞ in the same limiting way. In either case the equation b^y = 0 has no real solution, which is exactly what log_b(0) would have to be. Many references write log_b(0) = −∞ as shorthand for this limit, which is technically a limit statement (lim_{x → 0⁺} log_b(x) = −∞ for b > 1) rather than an actual function value. The Quanta calculator rejects an argument of zero with an explicit error rather than returning −Infinity, so you can see the issue and decide how to handle it (often the right move in physical models is to add a tiny epsilon, like 1e−9, to avoid the singularity).
What is the change-of-base formula and when do I need it?
The change-of-base formula is log_b(x) = log_a(x) / log_a(b), which lets you express a logarithm in any base b in terms of a logarithm in any other base a. The most common application is computing logarithms in bases other than 10 or e on a calculator that only has "log" and "ln" buttons. To compute log_2(50) on a basic calculator, type ln(50) / ln(2) (or log(50) / log(2)) — you get 5.6439. The proof is short: let y = log_b(x), so by definition b^y = x. Take log_a of both sides to get y · log_a(b) = log_a(x), and divide by log_a(b) to obtain y = log_a(x) / log_a(b), which is what we wanted. The Quanta calculator uses this formula internally with a = e, computing every log_b(x) as ln(x) / ln(b) — that is why it can handle any base without needing a separate library function for each.
Why can't the base of a logarithm equal 1?
Because the equation b^y = x with b = 1 is 1^y = x, which is always 1 no matter what y is. That means the only argument that has any solution at all is x = 1, and even then every real y is a solution — so log_1(1) would be every real number simultaneously, which is not a well-defined function. Mechanically in the change-of-base formula log_b(x) = ln(x) / ln(b), setting b = 1 gives ln(1) = 0 in the denominator, producing a division by zero. The base must therefore be strictly positive and strictly different from 1. The Quanta calculator enforces both constraints and will refuse to compute with b = 1 or b ≤ 0.
What does the antilog (inverse logarithm) mean?
The antilog is just exponentiation — the inverse operation of taking a logarithm. If log_b(x) = y, then the antilog of y (in base b) is b^y = x. The word "antilog" is a holdover from the slide-rule era when engineers would look up a logarithm in a table, do arithmetic with it, then look the answer back up in an "antilog table" to convert it back to the original scale. In this calculator the "argument" mode is the antilog mode: enter a base and a logarithm result and it returns the original number. Antilogs come up constantly in applied work — converting a decibel reading back to a power ratio (power = 10^(dB/10)), converting a pH back to a hydrogen-ion concentration ([H⁺] = 10^(−pH)), inverting log-transformed regression coefficients in statistics (effect on original scale = exp(coefficient on log scale)), and reading the population at time t from a fitted exponential model (N(t) = N_0 · e^(rt)).
Where do logarithms show up in real life?
Everywhere there is exponential growth, exponential decay, or human perception of intensity. Sound: decibels are 10 · log_10 of a power ratio — every 10 dB is a 10× increase in sound power. Acidity: pH is −log_10 of the hydrogen-ion concentration in moles per litre — orange juice at pH 3 has 10,000 times more H⁺ than water at pH 7. Earthquakes: the Richter (moment) magnitude is log_10 of the seismic-wave amplitude — a magnitude 7 quake is 1000 times more powerful than a magnitude 4. Astronomy: stellar magnitudes are −2.5 · log_10 of brightness — the brightest stars are negative numbers and each step of 5 magnitudes is exactly a factor of 100 in brightness. Information theory: a message with N equally likely possibilities carries log_2(N) bits of information. Computer science: binary search and balanced trees run in O(log n) time. Finance: continuous-compounding doubling time is ln(2) / r — at 7% annual rate, money doubles in ln(2)/0.07 ≈ 9.9 years. Biology, chemistry, machine learning (log-likelihood, cross-entropy loss), psychophysics (Weber-Fechner law), and music (semitones are 2^(1/12)) all live on logarithmic scales.
What's the difference between log_2, log_10, and ln?
All three are logarithms — they answer the same kind of question ("what exponent makes this work?") — but in different bases, so they give numerically different answers for the same argument. log_2(x), the binary log, asks "2 to what power equals x?" — used in computer science and information theory. log_2(8) = 3, log_2(1024) = 10, log_2(1,048,576) = 20. log_10(x), the common log, asks "10 to what power equals x?" — used in engineering scales. log_10(1000) = 3, log_10(1,000,000) = 6. ln(x) = log_e(x), the natural log, asks "e to what power equals x?" where e ≈ 2.71828 — used in calculus and continuous-growth models. ln(e) = 1, ln(e²) = 2, ln(1) = 0. The three are related by simple multiplicative constants: log_2(x) = ln(x) / ln(2) ≈ ln(x) × 1.4427, log_10(x) = ln(x) / ln(10) ≈ ln(x) × 0.4343, log_2(x) = log_10(x) × log_2(10) ≈ log_10(x) × 3.3219. The Quanta calculator lets you set any base directly, so you never have to memorise the conversions.

References& sources.

  1. [1]NIST Digital Library of Mathematical Functions, §4 — Elementary Functions, particularly §4.1 (Logarithm, Exponential, Powers) and §4.2 (Definitions). The definitive modern reference for the logarithm's analytic definition, identities, and numerical evaluation.
  2. [2]Stewart, James. Calculus: Early Transcendentals, 9th edition. Cengage Learning, 2020 — Chapter 6 (Inverse Functions: Exponential, Logarithmic, and Inverse Trigonometric Functions) gives the standard undergraduate treatment of the natural logarithm via the integral definition ln(x) = ∫₁ˣ (1/t) dt, the change-of-base formula, and all three algebraic identities (product, quotient, power).
  3. [3]Encyclopedia Britannica, "Logarithm" — historical and conceptual overview, including John Napier's 1614 publication Mirifici Logarithmorum Canonis Descriptio and Henry Briggs's 1617 reformulation in base 10 ("Briggs logarithms" / common logarithms).
  4. [4]Khan Academy, Algebra 2 — Logarithms unit. Peer-reviewed curriculum-aligned reference covering log_b(x) definition, change of base, log laws (product, quotient, power), and inverse relationship to exponentiation. Aligned to Common Core State Standards F-BF.5 and F-LE.4.
  5. [5]Abramowitz, M. and Stegun, I. A. (eds.) Handbook of Mathematical Functions with Formulas, Graphs, and Mathematical Tables. National Bureau of Standards Applied Mathematics Series 55, 1964 — §4.1 lists the logarithm's series expansions, identities, and numerical properties. Still cited by NIST DLMF as a foundational reference.
  6. [6]ISO 80000-2:2019 — Quantities and units, Part 2: Mathematics. International standard fixing the notation log_b(x), ln(x) for log_e(x), lg(x) for log_2(x), and the constraints b > 0, b ≠ 1, x > 0.
  7. [7]Maor, Eli. e: The Story of a Number. Princeton University Press, 1994 — peer-reviewed monograph tracing the history of e and the natural logarithm from Napier (1614) and Briggs (1617) through Bernoulli, Euler, and modern applications.

In this category

Embed

Quanta Pro

Paid features are coming later.

  • All 313 calculators remain free
  • No billing is enabled
Coming soon