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.
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:
- log2(8) = 3 because 2³ = 8
- log10(1000) = 3 because 10³ = 1000
- log10(0.01) = −2 because 10−2 = 0.01
- ln(e²) = 2 because e² is just e raised to the power 2
The three types of logarithms you'll encounter most frequently:
| Type | Symbol | Base | Primary Use |
|---|---|---|---|
| Common logarithm | log or log₁₀ | 10 | pH, decibels, Richter scale |
| Natural logarithm | ln or logₑ | e ≈ 2.71828 | Calculus, growth/decay, statistics |
| Binary logarithm | log₂ or lb | 2 | Computer 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.
| Law | Formula | Example (log₁₀) |
|---|---|---|
| Product rule | log(A × B) = log A + log B | log(100×10) = log 100 + log 10 = 2+1 = 3 |
| Quotient rule | log(A ÷ B) = log A − log B | log(1000÷10) = 3−1 = 2 |
| Power rule | log(Aⁿ) = n × log A | log(10⁵) = 5 × log 10 = 5 |
| Change of base | logb(x) = log(x) ÷ log(b) | log₂(8) = log(8)÷log(2) = 0.903÷0.301 = 3 |
| log of 1 | logb(1) = 0 for any base b | log(1) = 0 |
| log of base | logb(b) = 1 | log₁₀(10) = 1, ln(e) = 1 |
Two additional important identities:
- Inverse relationship: blogb(x) = x and logb(bx) = x — logarithms and exponentials are inverses.
- Negative arguments: Logarithms of negative numbers and zero are undefined in the real number system. log(−5) and log(0) have no real value.
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.
| Expression | Value | Application |
|---|---|---|
| ln(1) | 0 | Starting point (e⁰ = 1) |
| ln(e) | 1 | Definition of natural log |
| ln(2) | ≈ 0.6931 | Doubling time = ln(2)/r |
| ln(10) | ≈ 2.3026 | Convert log₁₀ to ln: ln(x) = 2.3026 × log₁₀(x) |
| ln(0.5) | ≈ −0.6931 | Half-life = ln(0.5)/−λ |
| ln(100) | ≈ 4.6052 | Common in statistical calculations |
Natural log in practice:
- Continuous compound interest: A = Pert. $1,000 at 5% for 10 years: A = 1000 × e0.5 = $1,648.72
- Radioactive decay: N(t) = N₀ × e−λt. Half-life: t₁/₂ = ln(2)/λ ≈ 0.693/λ
- Population modeling: P(t) = P₀ × ert, where r is the continuous growth rate
- Normal distribution: The Gaussian bell curve exponent −x²/2 uses e
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 |
| 1 | 0.000 | 0.000 | 0.000 |
| 2 | 0.301 | 0.693 | 1.000 |
| 5 | 0.699 | 1.609 | 2.322 |
| 10 | 1.000 | 2.303 | 3.322 |
| 50 | 1.699 | 3.912 | 5.644 |
| 100 | 2.000 | 4.605 | 6.644 |
| 500 | 2.699 | 6.215 | 8.966 |
| 1,000 | 3.000 | 6.908 | 9.966 |
| 10,000 | 4.000 | 9.210 | 13.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 Type | Example | Solution Method | Answer |
|---|---|---|---|
| Find exponent | 2ˣ = 32 | x = log₂(32) = log(32)/log(2) | x = 5 |
| Find time to double | e^(0.06t) = 2 | 0.06t = ln(2); t = 0.693/0.06 | t ≈ 11.6 yrs |
| Combine logs | log(x) + log(x−3) = 1 | log[x(x−3)] = 1; x²−3x = 10 | x = 5 |
| Change base | log₈(x) = 2 | x = 8² = 64 | x = 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.
- If 10² = 100, then log₁₀(100) = 2
- If e³ ≈ 20.09, then ln(20.09) ≈ 3
- If 2⁸ = 256, then log₂(256) = 8
- 10^(log₁₀(x)) = x and log₁₀(10^x) = x — perfect cancellation
On a scientific calculator:
- To compute log₁₀(x): press the LOG key
- To compute ln(x): press the LN key
- To compute logb(x): use change of base: log(x) ÷ log(b)
- To reverse (antilog): press 10^x (for common log) or e^x (for natural log)
Logarithms in Statistics and Data Analysis
Log transformations are a powerful tool in statistics for dealing with skewed data and multiplicative relationships.
- Log-normal distribution: If a variable's logarithm is normally distributed, the variable is log-normally distributed. Stock prices, income, city sizes, and biological measurements often follow log-normal distributions.
- Log scale charts: When data spans multiple orders of magnitude (e.g., COVID-19 case counts going from 100 to 1,000,000), a log scale makes the trend visible — each equal spacing represents a 10× multiplication rather than a fixed addition.
- Regression: Log-linear regression (log y = a + bx) models exponential growth. Log-log regression (log y = a + b × log x) models power-law relationships like Pareto distributions.
- Information entropy: Shannon entropy H = −Σ p(x) log₂(p(x)) measures information content in bits. A fair coin has entropy 1 bit; a fair die has entropy log₂(6) ≈ 2.585 bits.
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: eiπ + 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:
- 1614: Napier publishes Mirifici Logarithmorum Canonis Descriptio (first logarithm tables)
- 1624: Briggs publishes Arithmetica Logarithmica (base-10 log tables)
- 1668: Nicolaus Mercator discovers the series expansion ln(1+x) = x − x²/2 + x³/3 − …
- 1748: Euler establishes e and the natural logarithm in Introductio in Analysin Infinitorum
- 1970s: Electronic calculators replace log tables; slide rules become obsolete
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:
- log(A + B) ≠ log(A) + log(B): The product rule applies only to multiplication, not addition. log(A + B) has no simple simplification. This is one of the most common algebra errors: log(3 + 7) ≠ log(3) + log(7).
- log(A × B) ≠ log(A) × log(B): The product rule says log(A × B) = log(A) + log(B) (addition, not multiplication). log(2 × 8) = log(16) = log(2) + log(8) = 0.301 + 0.903 = 1.204. But log(2) × log(8) = 0.301 × 0.903 = 0.272 — completely different.
- Forgetting the base: When a formula specifies "log," always determine the base from context. In mathematics, "log" often means natural log (base e). In engineering and applied science, "log" typically means base 10. In computer science, it often means base 2. Misidentifying the base produces errors up to a factor of 3+ in the result.
- Negative arguments: log(−x) is undefined for real numbers, no matter how small the negative number. If your calculation yields a negative argument to a log function, check your signs first.
- log(x/y) ≠ log(x)/log(y): log(x/y) = log(x) − log(y) (subtraction). log(x)/log(y) is actually the change-of-base formula: logy(x). These are entirely different operations.
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:
| Quantity | Value | log₁₀(value) | Interpretation |
|---|---|---|---|
| Diameter of a proton | 10⁻¹⁵ m | −15 | femtometer scale |
| DNA strand width | 2×10⁻⁹ m | −8.7 | nanometer scale |
| Human hair diameter | 7×10⁻⁵ m | −4.15 | 0.07 mm |
| Human height | 1.75 m | 0.243 | meter scale |
| Earth circumference | 4×10⁷ m | 7.6 | 40,000 km |
| Distance to Moon | 3.84×10⁸ m | 8.58 | 384,000 km |
| Distance to Sun | 1.5×10¹¹ m | 11.18 | 150 million km |
| Distance to nearest star | 4×10¹⁶ m | 16.6 | 4.24 light-years |
| Observable universe | 8.8×10²⁶ m | 26.94 | 93 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.