Skip to main content
🔬 Advanced

Logarithm Calculator

Calculate logarithms with any base. Natural log (ln), common log (log10), and custom base logarithms. This free math tool gives instant, accurate results.

★★★★★ 4.8/5 · 📊 0 calculations · 🔒 Private & free

What Is a Logarithm?

A logarithm answers a fundamental question: "To what power must a base be raised to produce a given number?" Written mathematically, if bx = y, then logb(y) = x. The logarithm is the exponent — it undoes exponentiation just as subtraction undoes addition.

Concrete examples:

The three types of logarithms you'll encounter most frequently:

TypeSymbolBasePrimary Use
Common logarithmlog or log₁₀10pH, decibels, Richter scale
Natural logarithmln or logₑe ≈ 2.71828Calculus, growth/decay, statistics
Binary logarithmlog₂ or lb2Computer science, information theory

Our calculator computes all three simultaneously, plus any custom base you specify. Simply enter your number and (optionally) a custom base — log₁₀ and ln are always shown automatically.

Logarithm Laws and Properties

Six fundamental rules govern how logarithms behave. Mastering these properties is the key to simplifying complex expressions and solving logarithmic equations.

LawFormulaExample (log₁₀)
Product rulelog(A × B) = log A + log Blog(100×10) = log 100 + log 10 = 2+1 = 3
Quotient rulelog(A ÷ B) = log A − log Blog(1000÷10) = 3−1 = 2
Power rulelog(Aⁿ) = n × log Alog(10⁵) = 5 × log 10 = 5
Change of baselogb(x) = log(x) ÷ log(b)log₂(8) = log(8)÷log(2) = 0.903÷0.301 = 3
log of 1logb(1) = 0 for any base blog(1) = 0
log of baselogb(b) = 1log₁₀(10) = 1, ln(e) = 1

Two additional important identities:

A key application of the product rule: solving for unknown exponents. To find how long it takes an investment to double at 7% annual growth: 2 = 1.07n. Take log of both sides: log(2) = n × log(1.07), so n = log(2)/log(1.07) = 0.301/0.0294 ≈ 10.2 years (the famous Rule of 72: 72/7 ≈ 10.3 years).

The Natural Logarithm (ln) and Euler's Number e

Euler's number e ≈ 2.71828182845… is one of the most important constants in mathematics. It arises naturally from the problem of continuous compounding: if you invest $1 at 100% annual interest, compounding n times per year, the result approaches e as n → ∞.

The natural logarithm ln(x) = loge(x) is the inverse of ex, making it the natural companion to exponential functions in calculus. The key property: d/dx[ln(x)] = 1/x — simpler than the derivative for any other logarithm base.

ExpressionValueApplication
ln(1)0Starting point (e⁰ = 1)
ln(e)1Definition of natural log
ln(2)≈ 0.6931Doubling time = ln(2)/r
ln(10)≈ 2.3026Convert log₁₀ to ln: ln(x) = 2.3026 × log₁₀(x)
ln(0.5)≈ −0.6931Half-life = ln(0.5)/−λ
ln(100)≈ 4.6052Common in statistical calculations

Natural log in practice:

Common Log (log₁₀) Reference Table

The common logarithm (base 10) is used in most measurement scales involving orders of magnitude. This table gives reference values from 0.001 to 10,000.

Number (x)log₁₀(x)ln(x)log₂(x)
0.001−3.000−6.908−9.966
0.01−2.000−4.605−6.644
0.1−1.000−2.303−3.322
10.0000.0000.000
20.3010.6931.000
50.6991.6092.322
101.0002.3033.322
501.6993.9125.644
1002.0004.6056.644
5002.6996.2158.966
1,0003.0006.9089.966
10,0004.0009.21013.288

Real-World Applications of Logarithms

Logarithms appear wherever exponential processes need to be measured on a human-readable linear scale. They compress enormous ranges of values into manageable numbers.

<h3>pH and Chemistry</h3>
<p>pH = −log₁₀[H⁺], where [H⁺] is the hydrogen ion concentration in moles per liter. Each unit change in pH represents a 10× change in acidity. pH 4 (tomato juice) is 1,000 times more acidic than pH 7 (pure water). Battery acid at pH 1 is 1,000,000 times more acidic than neutral water.</p>

<h3>Richter and Moment Magnitude Scales</h3>
<p>Earthquake magnitude M is logarithmic. Each integer increase in magnitude = 10× more ground motion amplitude and roughly 31.6× more energy released. A magnitude 9 earthquake (rare) releases about 1,000× the energy of a magnitude 7 earthquake.</p>

<h3>Decibels (Sound and Electronics)</h3>
<p>Sound intensity in decibels: dB = 10 × log₁₀(P₂/P₁). A 10 dB increase = 10× the acoustic power (but perceived as roughly twice as loud). Human hearing spans a range of about 10<sup>12</sup> in intensity, compressed into a 0–120 dB scale.</p>

<h3>Computer Science and Algorithm Analysis</h3>
<p>Binary search runs in O(log₂ n) time. Searching through one million sorted items: log₂(1,000,000) ≈ 20 comparisons. Sorting n items with merge sort: O(n log n). The number of bits needed to represent n distinct values: ⌈log₂(n)⌉ bits.</p>

<h3>Finance: The Rule of 72</h3>
<p>An investment doubles in approximately 72/r years, where r is the annual return percentage. This comes directly from logarithms: doubling time = ln(2)/r ≈ 0.693/r. Multiplying by 100 gives the rule of 72 (approximately). At 8% annual growth: 72/8 = 9 years to double.</p>

Solving Logarithmic Equations Step by Step

Logarithmic equations appear in finance, science, and engineering. Here are four common equation types with solutions.

Equation TypeExampleSolution MethodAnswer
Find exponent2ˣ = 32x = log₂(32) = log(32)/log(2)x = 5
Find time to doublee^(0.06t) = 20.06t = ln(2); t = 0.693/0.06t ≈ 11.6 yrs
Combine logslog(x) + log(x−3) = 1log[x(x−3)] = 1; x²−3x = 10x = 5
Change baselog₈(x) = 2x = 8² = 64x = 64

General strategy: isolate the logarithm on one side, then convert to exponential form (if logb(x) = c, then x = bc). Check your answer — logarithms require positive arguments, so extraneous solutions can arise.

Logarithm vs Exponent: Inverse Operations

Logarithms and exponentials are inverse operations — each undoes the other, just as multiplication and division are inverses.

On a scientific calculator:

Logarithms in Statistics and Data Analysis

Log transformations are a powerful tool in statistics for dealing with skewed data and multiplicative relationships.

Frequently Asked Questions

What is log base 10 of 1,000?

log₁₀(1000) = 3, because 10³ = 1,000. In general, log₁₀(10ⁿ) = n for any integer n. This is why the common logarithm is so useful for counting digits: log₁₀(x) tells you roughly how many digits the number has — a 6-digit number like 500,000 has log₁₀(500,000) ≈ 5.7.

What is the natural log of 1?

ln(1) = 0. This is because e⁰ = 1. In general, the logarithm of 1 in any base equals 0, since b⁰ = 1 for any valid base b. This is the starting point on the natural log scale — every number greater than 1 has a positive natural log, and every number between 0 and 1 has a negative natural log.

How do I calculate log₂(64)?

log₂(64) = 6, because 2⁶ = 64. You can also use the change of base formula: log₂(64) = log(64) ÷ log(2) = 1.806 ÷ 0.301 = 6. Or simply ask: how many times do you double 1 to reach 64? 1→2→4→8→16→32→64 — that's 6 doublings.

Why is the natural log base e and not something simpler?

Euler's number e is the unique base for which the derivative of bˣ is simply bˣ itself (not c × bˣ with some constant c ≠ 1). This makes e the natural choice for calculus. Additionally, e arises from the limit of (1 + 1/n)ⁿ as n → ∞, directly from continuous compound interest — it appears whenever you model continuous growth or decay.

What is the difference between log and ln on a calculator?

On a scientific calculator, "log" typically means log base 10 (common logarithm), while "ln" means log base e (natural logarithm). However, in higher mathematics and some programming languages (Python, JavaScript, MATLAB), log() returns the natural logarithm by default. Always verify what base is being used in your specific context.

Can you take the log of a negative number?

No — not in real numbers. The logarithm of a negative number or zero is undefined in real arithmetic because no real exponent of a positive base produces a negative result. In complex analysis, logs of negative numbers are defined using complex numbers: ln(−1) = iπ (Euler's famous identity: e + 1 = 0).

What is log(0)?

log(0) is undefined — it approaches negative infinity as the argument approaches zero from the positive side: lim(x→0⁺) log(x) = −∞. This is because 10^(−∞) = 0: you need an infinitely negative exponent to reach zero, so the logarithm has no finite value at zero.

How do I convert between ln and log₁₀?

Use the conversion factor ln(10) ≈ 2.302585: ln(x) = log₁₀(x) × 2.302585. Conversely: log₁₀(x) = ln(x) / 2.302585 = ln(x) × 0.434294. Example: log₁₀(50) = 1.699; ln(50) = 1.699 × 2.303 = 3.912.

What is the antilog (inverse log)?

The antilog reverses a logarithm. Antilog₁₀(x) = 10^x. Antilog_e(x) = e^x. If log₁₀(N) = 2.5, then N = 10^2.5 ≈ 316.23. On a calculator: press 10^x after entering your value. The antilog is essential when converting logarithmic measurements (like decibels or pH) back to linear quantities.

How are logarithms used in music?

Musical pitch uses logarithmic relationships. Each octave doubles the frequency, and there are 12 semitones per octave. The frequency of note n semitones above concert A (440 Hz) is: f = 440 × 2^(n/12). To find how many semitones separate two frequencies: semitones = 12 × log₂(f₂/f₁). The equal temperament tuning system is built on these logarithmic relationships.

Logarithm History and Mathematical Significance

Logarithms were invented in 1614 by Scottish mathematician John Napier, independently developed by Jost Bürgi, and popularized through logarithm tables that dramatically reduced the computational burden for astronomers, navigators, and engineers. Before calculators, multiplying large numbers required only adding their logarithms — transforming days of arithmetic into minutes.

John Napier's definition differed from the modern convention, using a base closer to 1/e. Henry Briggs (working with Napier) introduced the common logarithm (base 10) in 1617, publishing 14-digit log tables for 1 to 20,000 and 90,000 to 100,000 in 1624. These tables were used for 300+ years until electronic calculators made them obsolete in the 1970s.

The slide rule — a mechanical analog computer used from the 17th to 20th centuries — is a physical implementation of logarithm addition. Multiplying A × B on a slide rule means setting one scale at log(A), adding log(B), and reading off antilog(log(A)+log(B)) = A×B. NASA engineers used slide rules to calculate trajectories for the Apollo missions.

Key logarithm milestones:

Common Logarithm Mistakes and How to Avoid Them

Students and professionals alike make predictable errors when working with logarithms. Being aware of these pitfalls prevents costly mistakes in calculations:

Checking your work: verify log calculations by checking the inverse. If you claim log₂(64) = 6, verify: 2⁶ = 64. ✓ If you claim ln(x) = 2.5, verify: e^2.5 ≈ 12.18, so x must be 12.18. Always sanity-check with the exponential inverse, especially in exam settings or critical engineering calculations.

Logarithm Scale Comparisons: Putting Orders of Magnitude in Perspective

One of logarithms' most powerful features is their ability to express vastly different quantities on the same scale. Here are comparisons across several logarithmic scales that highlight how the log compression works:

QuantityValuelog₁₀(value)Interpretation
Diameter of a proton10⁻¹⁵ m−15femtometer scale
DNA strand width2×10⁻⁹ m−8.7nanometer scale
Human hair diameter7×10⁻⁵ m−4.150.07 mm
Human height1.75 m0.243meter scale
Earth circumference4×10⁷ m7.640,000 km
Distance to Moon3.84×10⁸ m8.58384,000 km
Distance to Sun1.5×10¹¹ m11.18150 million km
Distance to nearest star4×10¹⁶ m16.64.24 light-years
Observable universe8.8×10²⁶ m26.9493 billion light-years

The log₁₀ column spans from −15 to +27 — a range of just 42 units that represents a range of physical sizes spanning 42 orders of magnitude (10⁴²). Without logarithms, plotting the size of a proton and the size of the observable universe on the same chart would be physically impossible. This is why physicists, cosmologists, and astronomers rely on log scales as a fundamental visualization and calculation tool.

In everyday life, the decibel scale (sound), earthquake magnitude scale, star brightness magnitude scale (astronomy), and pH scale (chemistry) all use logarithms for exactly this reason: compressing enormously wide ranges into intuitive single-digit or double-digit numbers that humans can easily compare and communicate. Every time you read "a magnitude 6 earthquake is 10 times stronger than magnitude 5," you're using logarithmic reasoning — and now you know the math behind it. Logarithms are also fundamental to machine learning: the cross-entropy loss function (used in neural network training) is defined as −Σ yᵢ × log(pᵢ), where pᵢ are predicted probabilities. Training a large language model, an image classifier, or a recommendation system all ultimately involves minimizing a logarithmic loss function. Every modern AI product you interact with daily — from search engines to chatbots — was trained using logarithmic mathematics.

},{"@type":"Question","name":"What is the natural log of 1?","acceptedAnswer":{"@type":"Answer","text":"ln(1) = 0. This is because e⁰ = 1. In general, the logarithm of 1 in any base equals 0, since b⁰ = 1 for any base b."}},{"@type":"Question","name":"How do I calculate log₂(64)?","acceptedAnswer":{"@type":"Answer","text":"log₂(64) = 6, because 2⁶ = 64. Alternatively, using change of base: log₂(64) = log(64) ÷ log(2) = 1.806 ÷ 0.301 = 6."}},{"@type":"Question","name":"Why is the natural log base e and not something simpler?","acceptedAnswer":{"@type":"Answer","text":"Euler's number e is the unique base for which the derivative of eˣ is eˣ itself — making it the natural base for calculus. e = 1 + 1/1! + 1/2! + 1/3! + ... = 2.71828..., arising from compound interest in the limit of continuous compounding."}},{"@type":"Question","name":"What is the difference between log and ln on a calculator?","acceptedAnswer":{"@type":"Answer","text":"On a scientific calculator: 'log' usually means log base 10 (common logarithm). 'ln' means log base e (natural logarithm). Some calculators and computer languages use 'log' for natural log — always check the context."}}]}