📊 Logarithm Calculator

Evaluate a logarithm of any base using the change of base formula, or solve a logarithmic equation for x.

📊 Evaluate log_b(x)
Result
log_b(x)
Natural Log (ln x)
Log Base 10
Log Base 2
📊

Enter a base and x to evaluate the logarithm

🔁 Solve log_b(x) = y
Result
x
🔁

Enter a base and y to find x

Guide

About the Logarithm Calculator

Last updated: July 2026 · Reviewed by the NeftCal editorial team

This logarithm calculator is a free tool for evaluating log_b(x) — a logarithm of any positive base — using the change of base formula, or for solving a logarithmic equation log_b(x) = y for the unknown x. A logarithm answers the question "what power must the base be raised to, to produce this number?" It is the inverse operation of exponentiation, so every log calculation on this page is checked against, and can be verified by, the matching exponential calculation. Whether you need a log calculator for algebra homework, a natural log calculator (ln) for calculus, or a quick log base 2 calculator for computer science, this tool shows the formula and full working behind every result.

What the Logarithm Calculator Solves

The calculator has two linked tools. Evaluate log_b(x) takes a base b and an argument x and returns y, the exponent that makes b^y = x, using the universal change of base formula log_b(x) = ln(x) ÷ ln(b). It also displays the natural log, log base 10, and log base 2 of x for quick cross-reference. Solve for x in log_b(x) = y runs the operation in reverse: given a base and an exponent, it rewrites the equation in exponential form and computes x = b^y directly.

Who Should Use This Calculator

Algebra and precalculus students working through logarithm and exponential equation homework, computer science students analyzing algorithm time complexity, chemistry and biology students computing pH or population growth, audio and signal engineers converting to decibel scales, finance students solving for compounding periods, and anyone who needs a fast, verifiable log base b calculator without deriving the change of base formula by hand.

Why Logarithms Matter

Logarithms compress enormous ranges of numbers into small, comparable scales. A number as large as a billion and one as small as a millionth can both be represented with a modest logarithm value, which is why logarithmic scales appear throughout science and engineering — pH, decibels, earthquake magnitude, and star brightness are all logarithmic. Logarithms are also the standard tool for solving equations where the unknown sits in an exponent, such as "how many years until this investment doubles?"

Real-World Applications

Chemists use −log₁₀[H⁺] to compute pH. Audio engineers use 10·log₁₀(I/I₀) to express sound intensity in decibels. Seismologists report earthquake magnitude on the logarithmic Richter scale. Computer scientists use log₂ n to describe the time complexity of binary search and balanced trees. Financial analysts solve logarithmic equations to find the number of compounding periods needed to reach a savings goal. Biologists use logarithmic and exponential models to describe population growth or radioactive decay.

Tips for Accurate Results

  • Double-check that your base is positive and not equal to 1 — the calculator rejects any other value because log_b(x) is undefined there.
  • Remember x must be strictly positive in the Evaluate tool — log of zero or a negative number has no real answer.
  • Use the Solve for x tool to reverse-check an Evaluate result: if log_b(x) = y, then b raised to y should return your original x.
Formula

The Logarithm Formulas, Explained

The change of base formula, the three log rules, and the exponential form used to solve for x

Change of base formula (used to evaluate any base)
log_b(x) = ln(x) ÷ ln(b)

Exponential form (used to solve log_b(x) = y for x)
log_b(x) = y ⟺ x = bʸ

Product rule
log_b(m × n) = log_b(m) + log_b(n)

Quotient rule
log_b(m ÷ n) = log_b(m) − log_b(n)

Power rule
log_b(mᵖ) = p × log_b(m)

Where:
b = the base of the logarithm (must be positive and not equal to 1).
x = the argument of the logarithm (must be strictly positive).
y = the exponent/result — the answer to "b raised to what power gives x?"
ln = the natural logarithm (base e), used internally to evaluate any base via change of base.
m, n, p = any valid logarithm arguments and exponents used in the product, quotient, and power rules.
🔄

Logs and Exponents Are Inverses

log_b(x) = y is exactly the same statement as bʸ = x. This calculator's two tools verify each other by moving between these two forms.

📏

Natural Log vs Any-Base Log

ln(x) is log base e. Every other base is computed from it via change of base: log_b(x) = ln(x) ÷ ln(b), so only one internal log function is ever needed.

⚠️

Two Hard Requirements

The base must be positive and not 1; the argument x must be strictly positive. Violating either makes the logarithm undefined in the real numbers.

⚙️ Why This Formula Works

Because logarithms of different bases are all proportional to each other (they differ only by a constant multiplier, 1/ln(b)), any base's logarithm can be recovered from a single natural-log function. This is why programming languages and calculators only need to implement ln(x) internally, then derive log base 10, log base 2, or any other base from it using the change of base formula.

🎯 When to Use Each Tool

  • Evaluate log_b(x): you know the base and the number, and want the exponent
  • Solve log_b(x) = y for x: you know the base and the exponent, and want the number
  • Log rules: use product/quotient/power rules to simplify an expression before evaluating

📋 Assumptions

  • The base b is treated as a real number greater than 0 and not equal to 1
  • The argument x (Evaluate tool) is treated as a strictly positive real number
  • The exponent y (Solve tool) can be any real number, including negative, zero, or decimal

⚠️ Limitations of the Formula

  • Undefined for x ≤ 0 — logarithms of zero or negative numbers have no real value
  • Undefined for base ≤ 0 or base = 1 — these bases can't represent every real exponent
  • Only evaluates real logarithms — does not compute complex-valued logarithms
Walkthrough

Step-by-Step: How to Use the Logarithm Calculator

From picking a tool to verifying the answer

Pick the calculation mode

Choose Evaluate log_b(x) to compute a logarithm, or Solve for x in log_b(x) = y to work backward from a known exponent.

Enter the base (b)

Type a base that is positive and not equal to 1 — common choices are 2, 10, or e (≈2.71828), but any valid positive base works.

Enter x or y

For Evaluate, enter the argument x (must be greater than 0). For Solve for x, enter the exponent y — any real number, including negatives or decimals.

Click "Calculate"

The calculator applies the change of base formula, or rewrites the equation in exponential form, and displays the result instantly.

Read the result and reference values

Evaluate mode also shows ln(x), log base 10 of x, and log base 2 of x side by side, so you can compare the same number across common bases.

Verify the answer (optional)

Switch tools and rewrite your equation in the other form — x = bʸ — to confirm both tools agree on the same numbers.

Example

Worked Example

Evaluate log₂(8), then verify it with the Solve for x tool

Scenario

What power must 2 be raised to, to get 8? We'll evaluate log₂(8) using the change of base formula, then confirm the answer by solving log₂(x) = 3 for x.

Base (b)2
Argument (x)8
Expected y3
Step 1 — Apply the change of base formula: log_2(8) = ln(8) ÷ ln(2).
Step 2 — Compute the natural logs: ln(8) ≈ 2.079442, ln(2) ≈ 0.693147.
Step 3 — Divide: 2.079442 ÷ 0.693147 ≈ 3.
Step 4 — Cross-check the reference values: log base 10 of 8 ≈ 0.903090, and log base 2 of 8 = 3 exactly — matching our result.
Step 5 — Verify with Solve for x: log_2(x) = 3 rewritten in exponential form is x = 2³ = 8, which matches the original argument exactly.
log₂(8)
3
ln(8)
≈2.0794
Verified x
8

Explanation: Because 2³ = 8, log base 2 of 8 must equal exactly 3 — and the change of base formula, using natural logs, arrives at the same answer through division rather than trial and error. This is the entire value of the change of base formula: it lets a calculator compute a logarithm of any base using only a single natural-log function, then the Solve for x tool proves the result is correct by rebuilding 8 from 2³.

Interpretation

Understanding Your Logarithm Result

What each field in the result actually represents

FieldWhat It MeansExample Reading
log_b(x) result (y)The exponent that base b must be raised to, to produce xlog₂(8) = 3 → 2 must be cubed to reach 8
ln(x), log₁₀(x), log₂(x) reference valuesThe same x evaluated in three common bases, for quick comparisonx=8 → ln≈2.0794, log₁₀≈0.9031, log₂=3
x (Solve for x tool)The value produced when base b is raised to exponent ylog₂(x)=3 → x=8
Undefined / rejected inputsBase ≤ 0, base = 1, or x ≤ 0 — outside the domain of real logarithmsbase=1 or x=−5 is blocked with an error message

Typical ranges: log_b(x) is negative whenever 0 < x < 1 (for a base greater than 1), zero when x = 1, and positive when x > 1. There's no upper or lower bound — logarithms can be arbitrarily large or small as x grows or shrinks.

Manual verification: the fastest sanity check for any log_b(x) = y result is to compute b^y by hand or with the Solve for x tool — it should return your original x exactly (aside from tiny floating-point rounding).

Use Cases

Practical Use Cases for the Logarithm Calculator

Where logarithm calculations show up across school, science, and industry

🎓

Algebra & precalculus homework

Evaluate logarithms and solve logarithmic equations step by step, in any base.

📐

Change of base practice

Check change-of-base formula calculations for a base your calculator doesn't support directly.

🧪

Chemistry — pH calculations

Compute pH from hydrogen ion concentration using the log base 10 formula.

🌍

Earth science — earthquake magnitude

Understand Richter scale readings, which are logarithmic measures of seismic energy.

🔊

Audio engineering — decibel levels

Convert sound intensity ratios into the logarithmic decibel scale.

💻

Computer science — algorithm complexity

Analyze O(log n) time complexity for binary search, balanced trees, and divide-and-conquer algorithms.

🧮

Binary & data structures

Use log base 2 to estimate tree depth or the number of bits needed to represent n values.

📈

Finance — compounding periods

Solve for the number of periods needed for an investment to reach a target value at a given growth rate.

🧬

Biology — growth & decay models

Analyze population growth or radioactive decay using logarithmic and exponential relationships.

📊

Data science — log-transforming data

Apply logarithmic transforms to normalize skewed data before statistical modeling.

🎯

Standardized test prep

Practice logarithm and exponential equation questions common on algebra and college entrance exams.

🏗️

Engineering — signal processing

Work with logarithmic frequency and gain scales in filter and system design.

🔬

Physics — radioactive decay & half-life

Use logarithms to solve for elapsed time given a decay constant and remaining quantity.

Pros & Cons

Advantages and Limitations

What this logarithm calculator does well, and where manual judgment is still needed

✅ Advantages

  • Free, instant evaluation of a logarithm of any valid base
  • Runs entirely in your browser — no data ever leaves your device
  • Shows ln(x), log base 10 of x, and log base 2 of x alongside every result for quick comparison
  • Two tools in one: evaluate log_b(x), and solve log_b(x) = y for x
  • Displays the change of base formula and full step-by-step working, not just the answer
  • Accepts decimal bases and arguments for precise, non-integer logarithms
  • Handles negative, zero, and fractional exponents in the Solve for x tool
  • Validates inputs and clearly flags invalid bases or arguments
  • Useful across school, science, computer science, and finance contexts alike
  • Fast-loading and fully mobile-friendly
  • Removes manual change-of-base arithmetic errors
  • Free to use as many times as needed, with no calculation limit

⚠️ Limitations

  • Only evaluates real-valued logarithms — does not handle complex logarithms
  • Cannot solve log equations with the unknown in the base, or with multiple log terms combined
  • Rounds displayed results to 6 decimal places, which can hide precision loss on extreme values
  • Does not simplify expressions symbolically using the product, quotient, or power rules — it evaluates numerically only
  • Requires the user to already know which quantity is the base, argument, or exponent
  • Cannot evaluate log_b(x) when x ≤ 0 or when the base is ≤ 0 or equal to 1 — these are mathematically undefined
  • Does not graph the logarithmic function
Reference

Common Log vs Natural Log vs Binary Log

Three logarithm bases you'll encounter constantly, side by side

NameBaseCommon NotationTypical Use
Common Logarithm10log(x) or log₁₀(x)pH, decibels, Richter scale, orders of magnitude
Natural Logarithme ≈ 2.71828ln(x)Calculus, continuous growth/decay, compound interest
Binary Logarithm2log₂(x) or lb(x)Computer science, information theory, algorithm complexity

Common Mistakes and Expert Tips

❌ Common Mistakes

  • Forgetting that log_b(x) is undefined for x ≤ 0
  • Using a base of 1, which makes b^y constant and unable to represent any valid logarithm
  • Confusing the product rule with the power rule — multiplying instead of adding log_b(m) and log_b(n)
  • Mixing up ln (base e) with log (base 10) — they give very different results for the same x
  • Misapplying the power rule to something like (log_b(m))^p instead of log_b(m^p)
  • Assuming log_b(x) is always positive — it's negative whenever 0 < x < 1

💡 Expert Tips & Best Practices

  • Use the Exponent Calculator to double-check a b^y result before trusting a logarithm answer
  • Remember the golden rule: log_b(x) = y ⟺ x = bʸ — converting between the two forms is the fastest way to verify by hand
  • For very large or small x, cross-check with the Scientific Notation Calculator to catch order-of-magnitude errors
  • When solving real-world half-life or doubling-time problems, isolate the exponential term first, then take the log of both sides
  • Apply the product, quotient, and power rules by hand to simplify a complex expression before checking the numeric answer here
📝

Summary: This logarithm calculator gives you an instant, free way to evaluate log_b(x) for any valid base, with natural log, log base 10, and log base 2 reference values, and to solve logarithmic equations for x — all with the formula and steps shown. Pair it with the Exponent Calculator and Scientific Notation Calculator for a fuller picture of exponential math.

FAQ

Frequently Asked Questions

Common questions about logarithms

How do you 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). This calculator's Evaluate tool applies exactly this formula internally, so it can compute a logarithm of any valid base — not just 10 or e — using only the natural log function found in every calculator or programming language.
Why must the base of a logarithm be positive and not equal to 1?
A logarithm's base b must satisfy b > 0 and b ≠ 1 because the exponential function b^y needs to produce every positive real number exactly once as y varies. If b = 1, b^y is always 1 no matter what y is. If b ≤ 0, b^y is undefined or inconsistent for real exponents. This calculator rejects any base that is zero, negative, or exactly 1.
How do you solve log_b(x) = y for x?
Rewrite the logarithmic equation in its equivalent exponential form: x = b^y. For example, log_2(x) = 3 means x = 2^3 = 8. The Solve for x tool on this page enters the base b and exponent y and computes x = b^y directly.
Why must x be positive in log_b(x)?
Logarithms are only defined for positive arguments because no real power of a positive base b can ever equal zero or a negative number. Since log_b(x) asks "what power of b gives x," there is no real answer if x is zero or negative, so the Evaluate tool requires x > 0.
What is the difference between natural log, common log, and log base 2?
Natural log (ln) uses base e ≈ 2.71828 and is standard in calculus and continuous growth models. Common log (log base 10) counts powers of ten and is used in the pH scale, decibels, and the Richter scale. Log base 2 (binary log) counts doublings and appears throughout computer science, such as binary search's O(log n) complexity. The Evaluate tool shows all three reference values alongside your log_b(x) result.
What is the product rule of logarithms?
The product rule states log_b(m × n) = log_b(m) + log_b(n) — the logarithm of a product equals the sum of the logarithms. For example, log_2(4 × 8) = log_2(4) + log_2(8) = 2 + 3 = 5, matching log_2(32) = 5. This lets you break a complex logarithm into simpler, additive pieces.
What is the quotient rule of logarithms?
The quotient rule states log_b(m ÷ n) = log_b(m) − log_b(n) — the logarithm of a quotient equals the difference of the logarithms. For example, log_2(32 ÷ 4) = log_2(32) − log_2(4) = 5 − 2 = 3, matching log_2(8) = 3. It mirrors the product rule but with subtraction.
What is the power rule of logarithms?
The power rule states log_b(m^p) = p × log_b(m) — an exponent inside a logarithm can be pulled out as a multiplier. For example, log_2(8^2) = 2 × log_2(8) = 2 × 3 = 6, matching log_2(64) = 6. This rule is especially useful for solving equations where the unknown appears as an exponent.
What does log_b(1) equal, and why?
log_b(1) always equals 0 for any valid base b, because any positive base raised to the power 0 equals 1 (b^0 = 1). This holds regardless of the base — log base 10 of 1, ln(1), and log base 2 of 1 are all 0.
What does log_b(b) equal, and why?
log_b(b) always equals 1 for any valid base b, because raising a base to the power 1 simply returns itself (b^1 = b). For example, log base 5 of 5 equals 1 and ln(e) equals 1. This is a useful quick check when verifying a logarithm calculation by hand.
Can the result of a logarithm be negative or zero?
Yes. In the Solve for x tool, y (the exponent) can be any real number — positive, negative, zero, or a decimal. A negative y produces a fractional x between 0 and 1 (log base 2 of x = −1 means x = 2^−1 = 0.5), and y = 0 always gives x = 1. Similarly, log_b(x) evaluates to a negative number whenever 0 < x < 1 and b > 1.
How are logarithms used in the pH scale?
The pH scale measures acidity using pH = −log_10[H+], where [H+] is the hydrogen ion concentration in moles per liter. Because it's logarithmic, each one-unit drop in pH represents a tenfold increase in acidity — pH 4 is ten times more acidic than pH 5. This compresses an enormous range of concentrations into a simple 0–14 scale.
How are logarithms used in decibel sound measurements?
Sound intensity is measured in decibels using a logarithmic formula, roughly dB = 10 × log_10(I ÷ I₀), comparing a sound's intensity I to a reference intensity I₀. Because human hearing perceives loudness on a roughly logarithmic scale, this compresses a vast range of physical sound power into a manageable number — every 10 dB increase represents a tenfold increase in intensity.
How are logarithms used in computer science and algorithm complexity?
Binary search runs in O(log₂ n) time because it halves the search space with each comparison — searching one billion sorted items takes only about 30 comparisons (log base 2 of 1 billion ≈ 30). Balanced binary trees, efficient sorting algorithms, and many divide-and-conquer techniques all have logarithmic or log-linear time complexity.
What is the relationship between logarithms and exponents?
Logarithms and exponents are inverse operations. The statement log_b(x) = y is exactly equivalent to the exponential statement b^y = x. Every logarithmic equation can be rewritten as an exponential one and vice versa — this calculator's two tools, Evaluate and Solve for x, demonstrate both directions of that same relationship.
What is the change of base formula and why is it needed?
Most calculators and programming languages only provide a natural log (ln) or base-10 log function directly, not a function for an arbitrary base. The change of base formula, log_b(x) = ln(x) ÷ ln(b), converts any base-b logarithm into a ratio of two natural logs so it can be computed with just that one built-in function — exactly how this calculator's Evaluate tool works internally.
Learn More

Authoritative Resources on Logarithms

Trusted educational references to go deeper on the math behind logarithms

Related Calculators

Explore other math tools