Logarithm Calculator

Pick what you want to solve, enter your numbers, and see both forms of the answer plus a graph.

x must be a positive number. The result is the exponent that the base must be raised to in order to produce x.

Worked Examples

Example 1: Evaluate a Common Logarithm. log₁₀(1000)
10 raised to what power gives 1000? 10³ = 1000
log₁₀(1000) = 3
Example 2: Evaluate a Natural Logarithm. ln(e)
e raised to what power gives e? e¹ = e
ln(e) = 1
Example 3: Evaluate a Binary Logarithm. log₂(1024)
2¹⁰ = 1024 (this is why 1024 bytes make a kibibyte)
log₂(1024) = 10
Example 4: Find the Argument. log₂(x) = 7
x = 27 = 128
x = 128
Example 5: Find the Base. logₛ(81) = 4
b = 811/4 = 3, since 3⁴ = 81
b = 3
Example 6: Single Log Equation. log₃(x − 2) = 4
x − 2 = 3⁴ = 81
x = 81 + 2
x = 83
Example 7: Two Logs, Addition (with an extraneous root). log(x) + log(x − 9) = 1
log[x(x − 9)] = 1 → x(x − 9) = 10¹ = 10
x² − 9x − 10 = 0 → (x − 10)(x + 1) = 0 → x = 10 or x = −1
x = 10 accepted
x = −1 rejected: x − 9 = −10, a log cannot take a negative argument
Example 8: Two Logs, Subtraction. log₂(x) − log₂(x − 2) = 1
log₂[x/(x − 2)] = 1 → x/(x − 2) = 2¹ = 2
x = 2(x − 2) = 2x − 4 → 4 = x
x = 4 both x = 4 and x − 2 = 2 are positive

Try It Yourself

What is log₅(125)? (Hint: what power of 5 equals 125?)

What Is a Logarithm?

A logarithm answers one specific question: what exponent do you need to raise a fixed base to, in order to land on a given number? When we write logₛ(x) = y, we are asking "b raised to what power equals x?" and the answer is y. Every logarithmic statement has a twin exponential statement that says exactly the same thing in a different form. logₛ(x) = y and by = x are two ways of writing one relationship, and you can always rewrite one as the other. This is the single most important fact to internalize about logarithms: they are not a new, separate kind of arithmetic, they are the inverse operation of exponentiation, in the same way that subtraction undoes addition and division undoes multiplication.

Take log₂(8) as a concrete example. The question being asked is "2 raised to what power gives 8?" Since 2³ = 8, the answer is 3, so log₂(8) = 3. If instead you were asked to solve 2y = 8 for y, you would arrive at the identical answer through the identical reasoning. The two questions are the same question wearing different notation. Once this clicks, most of the mechanical rules for logarithms stop looking like arbitrary formulas to memorize and start looking like restatements of exponent rules you likely already know.

Visual 1 · The Log/Exponential Relationship
logₛ(x) = y
⇆
by = x

Both statements describe the same three numbers: the base b, the argument x, and the exponent y. The logarithmic form isolates y; the exponential form isolates x. Neither is more "correct" than the other, they are simply solved for different unknowns.

The Parts of a Logarithm

Every logarithm has three components. The base (b) is the number being repeatedly multiplied. The argument (x), sometimes called the operand, is the result of that repeated multiplication, and it is always required to be a positive number for a real-valued answer. The result (y), also called the logarithm itself, is the exponent, and it can be any real number, positive, negative, or zero. A negative result simply means the base was raised to a negative power, which produces a fraction. For example, log₂(0.25) = −2, because 2−2 = 1/4 = 0.25. A result of zero always means the argument equals 1, because any nonzero base raised to the power of 0 equals 1: logₛ(1) = 0 for every valid base b.

Common Log, Natural Log, and Binary Log

Three particular bases show up so often that they get their own shorthand notation, and this calculator treats all three as one-click presets.

Visual 2 · Three Bases You'll See Constantly

Common Log

Written simply as "log(x)" with no base shown, the common logarithm always means base 10. It matches the way our number system is built (ones, tens, hundreds), which makes it the standard choice in general science, engineering, and order-of-magnitude estimates.

Natural Log, ln(x)

The natural logarithm uses base e, an irrational constant approximately equal to 2.718281828. It arises naturally (hence the name) out of continuous growth and decay processes, and it is the default logarithm used throughout calculus, physics, and compound-growth finance.

Binary Log, log₂(x)

Base 2 is the language of on/off switches. Binary logarithms tell you how many times a quantity must double to reach a target, which is why they dominate computer science, data structures, and information theory.

Outside of these three, any other base is called a "custom base" and is written explicitly as a subscript, such as log₃(x) or log₂₀(x).

It is worth noting that some textbooks and calculators use "log" to mean the natural logarithm rather than the common logarithm, particularly in higher mathematics and many programming languages. This calculator always keeps common log (base 10) and natural log (ln) as clearly separate, labeled options so there is never any ambiguity about which one you are computing.

The Product, Quotient, and Power Rules

Because a logarithm is just an exponent, the familiar rules for combining exponents translate directly into rules for combining logarithms. These three rules are the backbone of simplifying and solving almost every logarithmic expression you will encounter.

The product rule says that the logarithm of a product equals the sum of the individual logarithms: logₛ(mn) = logₛ(m) + logₛ(n). This mirrors the exponent rule ap·aq = ap+q, because multiplying two numbers with the same base means adding their exponents. The quotient rule is the mirror image: logₛ(m/n) = logₛ(m) − logₛ(n), matching ap/aq = ap−q. The power rule says that logₛ(mp) = p·logₛ(m); raising the argument to a power multiplies the logarithm by that same power, because (ap)q = apq.

Visual 3 · The Three Core Rules

Product

logₛ(mn) =
logₛ(m)+logₛ(n)

Quotient

logₛ(m/n) =
logₛ(m)−logₛ(n)

Power

logₛ(mp) =
p·logₛ(m)

Identity

blogₛ(x) = x

These rules only combine logarithms that share the same base. You cannot add log₂(x) and log₃(y) together using the product rule; the bases must match first.

Before hand calculators existed, these three rules were the entire basis of the slide rule. Multiplying two large numbers by hand is slow and error prone, but adding their logarithms is fast, and the antilogarithm of that sum gives the product. Engineers and scientists relied on printed logarithm tables and mechanical slide rules for centuries because addition is so much easier than multiplication when the numbers get large.

The Change-of-Base Formula

Most calculators, and most programming languages, only provide built-in functions for common log and natural log. So what happens when you need log₃(20), a base that is not one of those two? The change-of-base formula solves this: logₛ(x) = ln(x)/ln(b), or equivalently logₛ(x) = log(x)/log(b). You can convert a logarithm of any base into a ratio of two logarithms of a base you already have a tool for. The base you switch to does not matter, natural log and common log both give the identical final answer, since the base you divide by cancels out algebraically.

Visual 4 · Change of Base in Action
log₃(20)
=
ln(20) ÷ ln(3)
=
2.928242 ÷ 1.098612

The result, approximately 2.726833, matches exactly what this calculator's Evaluate mode returns for a custom base of 3 with an argument of 20, because internally that is precisely the computation being performed.

Domain, Range, and the Vertical Asymptote

A logarithmic function y = logₛ(x) is only defined for positive arguments; the domain is x > 0. There is no real exponent you can raise a positive base to that produces zero or a negative number, so logₛ(0) and logₛ(negative number) both have no real-valued answer. As x approaches 0 from the positive side, logₛ(x) plunges toward negative infinity (for a base greater than 1); this behavior is called a vertical asymptote at x = 0, meaning the curve gets arbitrarily close to that vertical line but never touches or crosses it. The range of a logarithmic function, by contrast, is every real number: y can be as large or as small as you like, because you can always raise the base to a big enough or small enough exponent.

Two points always sit on any logarithmic curve regardless of the base, and this calculator's graph highlights both of them automatically. The point (1, 0) is always on the curve because b⁰ = 1 for any base. The point (b, 1) is always on the curve because b¹ = b. Whether the curve rises left-to-right (when b > 1) or falls left-to-right (when 0 < b < 1) depends entirely on whether the base is bigger or smaller than one; a base equal to 1 is disallowed altogether, since 1 raised to any power always equals 1, meaning it could never map onto any argument except exactly 1.

Visual 5 · Domain and the Asymptote
x = 0 undefined defined (x > 0)

The domain boundary at x = 0 is an open boundary: x = 0 itself is never included, no matter how large or small the base is.

Solving Logarithmic Equations Step by Step

Solving an equation with a single logarithm follows a repeatable pattern: isolate the logarithm on one side, then rewrite the equation in exponential form to eliminate the logarithm entirely. For log₃(x − 2) = 4, the logarithm is already isolated, so the next move is to rewrite it as x − 2 = 3⁴, which simplifies to x − 2 = 81, and finally x = 83. When a coefficient sits in front of the logarithm, such as 2·ln(x) = 6, divide both sides by that coefficient first to isolate the logarithm: ln(x) = 3, then rewrite as x = e³, which is approximately 20.085537.

Equations with two logarithms combined by addition or subtraction need one extra step before you can rewrite them exponentially: use the product or quotient rule to compress the two logarithms into a single logarithm first. log(x) + log(x − 9) = 1 becomes log[x(x − 9)] = 1 by the product rule, which then rewrites exponentially as x(x − 9) = 10, a quadratic equation you can solve normally. Subtraction works the same way through the quotient rule: log₂(x) − log₂(x − 2) = 1 becomes log₂[x/(x−2)] = 1, which rewrites as x/(x−2) = 2. For a deeper library of worked practice problems beyond what is shown on this page, Lamar University's Paul's Online Math Notes offers extensive solving logarithmic equations practice and examples covering many additional equation structures in detail.

Visual 6 · Undoing a Log to Solve an Equation
log₃(x − 2) = 4
↓ rewrite exponentially
x − 2 = 3⁴ = 81
↓ isolate x
x = 83

Extraneous Solutions and Why Domain-Checking Matters

Combining two logarithms into one and clearing them exponentially converts a logarithmic equation into an ordinary algebraic equation, often a quadratic, and quadratics frequently have two solutions. This is where a critical, easy-to-skip step comes in: every candidate solution must be checked against the domain of the original equation, not just the simplified one. Squaring, combining logs, and other algebraic moves can introduce roots that satisfy the simplified equation but make one of the original logarithms take a zero or negative argument, which is not allowed. A root that fails this check is called an extraneous solution, and it must be discarded even though it emerged from technically correct algebra.

The addition example above illustrates this perfectly. log(x) + log(x − 9) = 1 simplifies to x² − 9x − 10 = 0, which factors to (x − 10)(x + 1) = 0, giving two mathematically valid roots of the quadratic: x = 10 and x = −1. Plugging x = 10 back into the original equation gives log(10) + log(1), both defined, so x = 10 is accepted. Plugging x = −1 back in requires computing log(−1) and log(−10), and neither logarithm of a negative number is defined, so x = −1 must be rejected as extraneous, leaving x = 10 as the only true solution. This calculator performs that domain check automatically on every two-log addition and subtraction problem and displays each candidate's accept/reject status along with the specific reason, rather than silently dropping or silently keeping a root.

Visual 7 · Checking a Candidate Root

x = 10

x = 10 > 0 and x − 9 = 1 > 0. Both logarithm arguments are positive, so this root is kept.

x = −1

x − 9 = −10, which is negative. The second logarithm would be undefined, so this root is extraneous and discarded.

Real-World Uses: pH, Decibels, and the Richter Scale

Logarithms exist because some quantities in the physical world span such an enormous range of magnitudes that a plain linear scale becomes useless for comparing them. Logarithmic scales compress that range into manageable, human-readable numbers.

The pH scale measures how acidic or basic a solution is, based on the concentration of hydrogen ions, using pH = −log₁₀[H⁺]. Because it is a negative common logarithm, each single-unit drop in pH represents a tenfold increase in hydrogen ion concentration; a solution with pH 3 is ten times more acidic than one with pH 4, and one hundred times more acidic than pH 5. The decibel scale for sound intensity works similarly: decibels = 10·log₁₀(I/I₀), comparing a sound's intensity I to a reference threshold I₀. A jump of just 10 decibels represents a tenfold increase in actual sound power, which is why a rock concert at 110 dB is not merely "somewhat louder" than a quiet room at 30 dB, it carries roughly one hundred billion times the sound power. The Richter and moment magnitude scales for earthquakes are also base-10 logarithmic; an earthquake measuring magnitude 6 releases roughly 32 times more energy than one measuring magnitude 5, not simply "one unit more."

Visual 8 · Logarithmic Scales in the Real World
pH 3 (acidic)
10³× [H⁺]
pH 7 (neutral)
10⁵× [H⁺]
30 dB (quiet room)
10³× I₀
110 dB (concert)
10¹¹× I₀
Mag. 5 quake
baseline
Mag. 6 quake
≈32× energy

Bar lengths are illustrative, not to true physical scale, but the pattern holds: each step up a logarithmic scale represents multiplying, not adding, the underlying physical quantity.

Logarithms in Computer Science

Binary logarithms are everywhere in computing because computers store and address information in powers of two. If you need to know how many bits are required to represent N distinct values, the answer is log₂(N) rounded up to the next whole number; representing 1024 distinct states requires exactly log₂(1024) = 10 bits, which is exactly why 1024 (2¹⁰) bytes make a kibibyte. Binary logarithms also describe algorithmic efficiency: a binary search through a sorted list of a million items needs at most log₂(1,000,000), or about 20, comparisons to find any target, because each comparison eliminates half the remaining possibilities. This is the mathematical reason "divide and conquer" algorithms like binary search, merge sort, and balanced binary trees are described as running in O(log n) or O(n log n) time, and why they scale so gracefully even as the input size grows enormously.

Visual 9 · Bits Needed to Represent a Range of Values
2¹
2²
2³
2⁴
2⁵
2⁶
2&sup7;
2⁸

Doubling the number of representable states costs exactly one more bit, because adding 1 to an exponent doubles the result, and log₂ is precisely the operation that measures "how many doublings."

Common Mistakes to Avoid

A handful of errors show up constantly when people first learn logarithms. The product and quotient rules only combine logarithms that already share an identical base; log₂(x) + log₃(y) cannot be merged into a single logarithm without first converting one of them using the change-of-base formula. There is no rule that turns logₛ(m + n) into logₛ(m) + logₛ(n); addition inside the argument does not distribute over a logarithm the way multiplication does, and this is one of the single most common algebra mistakes involving logs. Finally, always remember that logₛ(0) and logₛ(negative number) are not "very large negative numbers" or errors to paper over; they are simply undefined, and any calculator, including this one, should say so plainly instead of returning a symbol like "-Infinity" or "NaN" that looks like a real numeric answer.

Visual 10 · A Rule That Does Not Exist

Correct: Product Rule

log(m · n) = log(m) + log(n). Multiplication inside the log becomes addition outside it.

Incorrect: No Such Rule

log(m + n) ≠ log(m) + log(n). Addition inside the log does not distribute over the logarithm at all.

Try it with numbers: log(2 + 3) = log(5) ≈ 0.699, while log(2) + log(3) ≈ 0.301 + 0.477 = 0.778. The two sides are not equal, confirming that addition inside a logarithm never simplifies this way.

Logarithm Formulas at a Glance

RuleFormulaMeaning
Definitionlogₛ(x) = y ↔ by = xThe two forms are interchangeable
Product Rulelogₛ(mn) = logₛ(m) + logₛ(n)Multiplying inside becomes adding outside
Quotient Rulelogₛ(m/n) = logₛ(m) − logₛ(n)Dividing inside becomes subtracting outside
Power Rulelogₛ(mp) = p·logₛ(m)An exponent inside comes out as a multiplier
Change of Baselogₛ(x) = ln(x) / ln(b)Compute any base with ln or log
Log of 1logₛ(1) = 0True for every valid base
Log of the Baselogₛ(b) = 1Any base raised to the first power is itself
Power of the Baselogₛ(bp) = pLogging and exponentiating with the same base cancel
Exponent Identityblogₛ(x) = xExponentiating undoes a same-base logarithm
Reciprocal Baselogₛ(x) = 1 / logₓ(b)Swapping base and argument gives a reciprocal

Logarithm Calculator or Another Math Tool?

Logarithm Calculator

I need to evaluate a log, find a missing base or argument, convert log/exponential form, or solve a logarithmic equation.

You are here

Exponent Calculator

I need to raise a number to a power, or work with negative and fractional exponents directly.

Open Calculator ›

Scientific Calculator

I need a general-purpose calculator with trig, roots, powers, and logs all in one keypad.

Open Calculator ›

Fraction Calculator

I need to add, subtract, multiply, divide, or simplify fractions rather than solve for an exponent.

Open Calculator ›

Compound Interest Calculator

I need to apply exponential growth to money over time, a common real-world use of logs in reverse.

Open Calculator ›

Questions People Actually Ask

What is a logarithm, in plain terms?

It is the exponent you would need to raise a fixed base to, in order to get a given number.

What is the difference between log and ln?

"log" with no base written means base 10 (common log); "ln" always means base e (natural log).

What is log base 2 used for?

Bit lengths, binary search, algorithm complexity, and anything involving repeated doubling.

Why can't you take the logarithm of a negative number?

No real exponent applied to a positive base ever produces a negative result, so no real-valued answer exists.

Why can't you take the logarithm of zero?

A positive base raised to any finite exponent never equals exactly zero; the curve only approaches zero as an asymptote.

Why can't the base of a logarithm be 1?

1 raised to any power always equals 1, so log base 1 could never equal anything except 1 itself, and is left undefined entirely.

Can the base be a fraction between 0 and 1?

Yes, and the resulting graph decreases from left to right instead of increasing.

What does logₛ(1) always equal?

0, for every valid base, because b⁰ = 1.

What does logₛ(b) always equal?

1, because any base raised to the first power equals itself.

What is the product rule?

logₛ(mn) = logₛ(m) + logₛ(n).

What is the quotient rule?

logₛ(m/n) = logₛ(m) − logₛ(n).

What is the power rule?

logₛ(mp) = p·logₛ(m).

What is the change-of-base formula?

logₛ(x) = ln(x)/ln(b), letting you compute any base using ln or common log.

What is an extraneous solution?

A root that solves the simplified algebraic equation but fails the original logarithm's domain, so it must be rejected.

Why does this calculator show rejected roots instead of just hiding them?

So you can see the full reasoning, including exactly why a mathematically valid quadratic root does not solve the original log equation.

How do I solve a single logarithmic equation?

Isolate the logarithm, then rewrite the equation in exponential form to remove it.

How do I solve an equation with two added logarithms?

Combine them with the product rule into one logarithm, then rewrite exponentially and check the domain of every root.

How do I solve an equation with two subtracted logarithms?

Combine them with the quotient rule into one logarithm, then rewrite exponentially and check the domain.

What is the vertical asymptote on a log graph?

The line x = 0, which the curve approaches but never touches or crosses.

What two points are always on a log graph?

(1, 0) and (b, 1), regardless of the base.

Is pH a logarithmic scale?

Yes; it is the negative common logarithm of hydrogen ion concentration.

Are decibels logarithmic?

Yes; a 10 dB increase corresponds to ten times the sound intensity.

Is the Richter scale logarithmic?

Yes; each whole step corresponds to roughly 32 times more released energy.

Can this calculator find a missing base or argument?

Yes, both Find the Argument and Find the Base are dedicated modes.

Can this calculator convert between log and exponential form?

Yes, the Convert mode shows both forms side by side.

Does the graph update automatically?

Yes, it redraws using whatever base is active in the current calculation, in every mode.

Sources & Further Reading

Methodology

How This Calculator Computes Its Results

Common, natural, and binary logarithms use JavaScript's built-in Math.log10, Math.log, and Math.log2 functions directly for maximum precision; any custom base is computed with the change-of-base formula, ln(x)/ln(b). Results that land extremely close to a whole number (within one part in a billion) are snapped to that exact integer, since this gap is floating-point rounding noise rather than a genuine fractional answer. Arguments of zero or a negative number, and bases that are zero, negative, or exactly 1, are intercepted before any division or logarithm is attempted and are always shown as a plain-language domain message, never as "NaN," "-Infinity," or "Infinity." Two-logarithm addition and subtraction equations are solved algebraically (as a quadratic for addition, a linear equation for subtraction), and every resulting candidate is substituted back into the original equation's domain requirements before being labeled accepted or rejected.

This calculator is provided for general educational and informational purposes only. It is not a substitute for instruction from a qualified teacher or textbook. Always double-check results that will be used for graded coursework, professional work, or any other high-stakes purpose.