ΣCALCULATORWizard 140+ Calculators

Log Calculator

Calculate logarithms for any base — log base 10, natural log (ln), log base 2, and more. Instant results with step-by-step solutions.

Common bases
Base 10 Base e (ln) Base 2 Base 3 Base 5
log10(1000) =
3
Check: 10³ = 1,000 ✓
3
Result
10³
Exponential
2.303
ln(1000)
9.966
log₂(1000)

Step-by-step solution

log₁₀(1000) = ln(1000) / ln(10)
= 6.9078 / 2.3026
= 3.0000
Natural log ln(x)
ln(x)
log₁₀(x)
log₂(x)
Ratio ln/log₁₀
Common examples
10³ 10⁶ 2⁸ 10⁻²
Antilog result b^y
Result
Scientific
log₁₀(result)
ln(result)

Understanding Logarithms — The Complete Guide

A logarithm answers a fundamental question: to what power must we raise a base number to get a given value? Written as logb(x) = y, it means by = x. So log10(1000) = 3 because 10³ = 1,000. Logarithms were invented in 1614 by John Napier specifically to simplify complex multiplication and division — before calculators existed, mathematicians used log tables to turn multiplication into addition.

Today, logarithms appear in virtually every quantitative field. The Richter scale for earthquakes is logarithmic — a magnitude 7.0 earthquake releases about 31.6 times more energy than a magnitude 6.0 quake, not 1.6 times more. The decibel scale for sound, pH scale for acidity, and the f-stop scale in photography are all logarithmic. In finance, logarithmic returns are used instead of simple returns because they're time-additive, making portfolio math far cleaner.

Computer scientists rely on log base 2 constantly. Binary search runs in O(log₂ n) time, meaning it takes only about 33 comparisons to find a specific value among 10 billion sorted items. The SHA-256 hash function underlying Bitcoin uses properties of logarithms. Data compression algorithms like Huffman coding and information theory are built on log base 2 measurements (bits).

The Three Most Important Logarithm Bases

BaseNotationNamePrimary UseExample
10log(x) or log₁₀(x)Common logEngineering, pH, decibelslog(100) = 2
e ≈ 2.71828ln(x)Natural logCalculus, finance, physicsln(e) = 1
2log₂(x) or lb(x)Binary logComputer science, informationlog₂(8) = 3

The Change of Base Formula

Any logarithm can be converted to any other base using the change of base formula: logb(x) = ln(x) / ln(b) = log(x) / log(b). This is how our calculator computes logarithms for any base — it uses JavaScript's built-in natural log function and divides. For example, log7(2401) = ln(2401) / ln(7) = 7.784 / 1.946 = 4.000, since 7⁴ = 2,401.

Key Logarithm Properties

PropertyFormulaExample
Product rulelog(a×b) = log(a) + log(b)log(100×10) = log(100) + log(10) = 3
Quotient rulelog(a/b) = log(a) − log(b)log(1000/10) = 3 − 1 = 2
Power rulelog(aⁿ) = n × log(a)log(10⁵) = 5 × log(10) = 5
Log of 1logb(1) = 0log(1) = 0, ln(1) = 0
Log of baselogb(b) = 1log(10) = 1, ln(e) = 1
Inverseb^(logb(x)) = x10^(log 5) = 5
💡 Pro Tip — The Power Rule Shortcut: When a number ends in zeros, its log base 10 is easy to estimate. log(1,000,000) = 6 because 10⁶ = 1,000,000. More precisely, for any number between 10ⁿ and 10ⁿ⁺¹, its log is between n and n+1. So log(500) is between 2 and 3, and specifically equals about 2.699. This lets you sanity-check answers quickly.

Logarithms in Real-World Applications

Understanding where logarithms appear in real life helps contextualize what can feel like abstract math. The Richter scale is perhaps the most famous example: each whole number increase represents roughly 31.6 times more energy released. A magnitude 9.0 earthquake (2011 Tohoku, Japan) released about 1,000 times more energy than a magnitude 7.0 quake. Scientists use log scales because otherwise the chart showing a 6.0 and a 9.0 would require the 9.0 bar to be 31,623 times taller.

In finance and investing, natural logarithms are used to calculate continuously compounded interest. The formula A = Pe^(rt) where e is Euler's number gives the exact amount after continuous compounding. A $10,000 investment at 7% continuously compounded for 30 years grows to $10,000 × e^(0.07×30) = $10,000 × e^2.1 ≈ $81,451. Log returns are also preferred in portfolio analysis because log(1.10) + log(1.20) = log(1.32), meaning you can simply add daily log returns to get the period total.

In music, the frequency ratio between two notes a semitone apart is 2^(1/12) ≈ 1.0595. An octave doubles frequency (log₂ of frequency doubles). This is why a piano's layout is logarithmic — equal physical distance on the keys represents equal ratios of frequency change, not equal absolute frequency changes.

Common Logarithm Values to Memorize

ExpressionValueWhy It Matters
log(2)0.30103Used to find how many digits a power of 2 has
log(3)0.47712Key for base-3 conversions
log(π)0.49715Appears in normal distribution calculations
ln(2)0.69315Doubling time formula: t = ln(2)/r
ln(10)2.30259Converts log₁₀ to ln: multiply by 2.30259
log₂(10)3.32193Bits needed to represent a decimal digit

Doubling Time Formula — Logarithms in Finance

One of the most practical uses of logarithms in personal finance is calculating doubling time. If an investment grows at rate r per period, the number of periods to double is t = ln(2) / ln(1+r) ≈ 0.6931 / r (for small r). The Rule of 72 approximates this as 72/r%, so at 8% annual return, money doubles in approximately 9 years (more precisely: ln(2)/ln(1.08) = 9.006 years). At 12%, it doubles in about 6.1 years.

💡 Pro Tip — Negative Logarithms: When the input value is between 0 and 1, the logarithm is negative. log(0.1) = −1 because 10⁻¹ = 0.1. log(0.001) = −3 because 10⁻³ = 0.001. This is exactly how pH works — pure water has [H⁺] = 10⁻⁷ molar concentration, so pH = −log(10⁻⁷) = 7. Battery acid at 10⁻¹ molar has pH = 1. The negative sign is just a convention to make pH a positive number for common solutions.

Frequently Asked Questions

What is the difference between log and ln?
log (without a base specified) almost always means log base 10 in engineering and everyday use, while ln always means the natural logarithm with base e ≈ 2.71828. In higher mathematics and physics, log often means ln — context determines which. They're related by the simple conversion: ln(x) = log(x) × ln(10) ≈ log(x) × 2.30259. So ln(100) = log(100) × 2.30259 = 2 × 2.30259 = 4.60517.
Why can't you take the log of a negative number or zero?
Logarithms are only defined for positive real numbers. Since b^y is always positive for any real y (when b is positive), there's no real exponent y that produces a negative result or zero. However, in complex mathematics, logarithms of negative numbers are defined using imaginary numbers — ln(−1) = iπ, which is related to Euler's famous identity e^(iπ) + 1 = 0. For real-world calculations, if you get an error trying to take the log of a negative number, it means the input doesn't make physical sense.
How do logarithms relate to exponential growth?
Logarithms and exponential functions are exact inverses of each other. If f(x) = b^x (exponential), then its inverse is f⁻¹(x) = logb(x). This is why logarithms "undo" exponentials and vice versa. Exponential growth compounds multiplicatively (each period multiplies by the same factor), while logarithms convert that multiplication into addition. A quantity growing at 7% per year will be 10 times larger after log(10)/log(1.07) ≈ 34 years.
What is the log of 0?
The log of 0 is undefined (approaches negative infinity as x approaches 0 from the right). As x gets closer and closer to 0, log(x) keeps decreasing without bound — log(0.1) = −1, log(0.001) = −3, log(0.000001) = −6. There's no finite number equal to log(0), because no finite power of 10 (or any positive base) equals exactly zero.
How is log base 2 used in computer science?
Log base 2 is fundamental in computer science because computers work in binary. The number of bits needed to store n distinct values is ceiling(log₂(n)). To store all 256 possible byte values, you need log₂(256) = 8 bits. Binary search requires log₂(n) comparisons to find an item in n sorted elements — so searching a billion sorted items takes only about 30 comparisons. Hash tables, balanced binary trees, merge sort, and countless algorithms have log₂(n) complexity at their core.
Can the base of a logarithm be a fraction or decimal?
Yes, any positive number except 1 can be a base. Fractional bases produce interesting results — if the base is between 0 and 1, the logarithm of numbers greater than 1 is negative. For example, log0.5(8) = −3, because 0.5⁻³ = 2³ = 8. Bases less than 1 appear in radioactive decay calculations, where the "half-life" formula uses base 0.5. Our calculator supports any positive base except 1 (where the logarithm is undefined).