Log, Ln & Custom Base
Last reviewed: May 2026
Calculate logarithms in any base: common (10), natural (e), binary (2), and custom. Logarithms are the inverse of exponentiation and appear throughout science, finance, and computer science.1
| x | log(x) | ln(x) | log2(x) |
|---|---|---|---|
| 2 | 0.301 | 0.693 | 1 |
| 10 | 1 | 2.303 | 3.322 |
| 100 | 2 | 4.605 | 6.644 |
| 1000 | 3 | 6.908 | 9.966 |
| Rule | Formula | Example |
|---|---|---|
| Product | log(ab) = log(a) + log(b) | log(200) = 2.301 |
| Quotient | log(a/b) = log(a) - log(b) | log(5) = 0.699 |
| Power | log(a^n) = n·log(a) | log(8) = 3·log(2) |
| Change base | log_b(x) = log(x)/log(b) | log2(10) = 3.322 |
A logarithm answers the question: "What power do I raise the base to in order to get this number?" Formally, log_b(x) = y means b^y = x. For example, log₁₀(1000) = 3 because 10³ = 1000. Logarithms are the inverse of exponentiation — they undo what exponents do, just as division undoes multiplication. This inverse relationship makes them essential for solving equations where the unknown is an exponent.
Common logarithm (log₁₀ or simply "log"): Base 10. Used in decibel calculations, pH chemistry, earthquake magnitude (Richter scale), and engineering. log₁₀(100) = 2. Natural logarithm (ln or logₑ): Base e ≈ 2.71828. Used in calculus, compound interest, radioactive decay, population growth, and most scientific applications. ln(e) = 1. Binary logarithm (log₂): Base 2. Used in computer science for algorithm complexity, data structures, and information theory. log₂(256) = 8 (because 2⁸ = 256 — the number of values in a byte).
Three rules make logarithm manipulation straightforward: Product rule: log(a × b) = log(a) + log(b) — multiplication becomes addition. Quotient rule: log(a ÷ b) = log(a) − log(b) — division becomes subtraction. Power rule: log(a^n) = n × log(a) — exponents become multipliers. These properties are why slide rules worked — adding log scales physically performed multiplication. They also explain why logarithmic graph scales compress large ranges: log(1) = 0, log(10) = 1, log(100) = 2, log(1000) = 3 — equal spacing represents 10× increases.
Richter scale: Each whole number increase represents 10× more ground motion and ~31.6× more energy. A magnitude 6.0 earthquake releases 31.6× more energy than a 5.0. Decibels: 10 dB increase = 10× more sound intensity. Normal conversation (60 dB) is 100× more intense than a whisper (40 dB). pH scale: Each unit represents a 10× change in hydrogen ion concentration. pH 4 is 10× more acidic than pH 5 and 100× more than pH 6. Photographic stops: Each stop doubles or halves the light exposure — a logarithmic scale that simplifies exposure calculations.
The most common practical application: solving for time in compound growth/decay. "How long to double money at 8%?" becomes: 2 = 1.08^t → log(2) = t × log(1.08) → t = log(2)/log(1.08) = 0.301/0.0334 = 9.01 years. "When does a radioactive sample decay to 25% of its original amount with a half-life of 5 years?" 0.25 = 0.5^(t/5) → log(0.25) = (t/5) × log(0.5) → t = 5 × log(0.25)/log(0.5) = 10 years (two half-lives).
Logarithms transform multiplicative processes into additive ones, making growth analysis intuitive. Stock returns are often expressed as log returns: ln(P₂/P₁). Log returns are additive across time periods (unlike percentage returns), making them mathematically convenient for portfolio analysis. The natural log also appears in the continuous compounding formula: A = Pe^(rt), where the time to reach a target is t = ln(A/P)/r. To double money at 5% continuous compounding: t = ln(2)/0.05 = 13.86 years.
Human perception of many stimuli is logarithmic — we perceive equal ratios of intensity as equal differences. The Weber-Fechner law describes this: doubling light intensity doesn't feel "twice as bright" — it feels like a modest increase. This is why audio volume controls use logarithmic potentiometers, camera exposure uses f-stops (each stop = 2× light), and musical pitch uses octaves (each octave = 2× frequency). A piano keyboard is a visual representation of logarithmic frequency spacing — each key represents a constant ratio of frequencies, not a constant difference.
Most calculators have only two logarithm buttons: log (base 10) and ln (base e). To calculate a logarithm with any other base, use the change of base formula: log_b(x) = log(x)/log(b) = ln(x)/ln(b). For example, log₂(64) = log(64)/log(2) = 1.806/0.301 = 6. This technique is essential for solving exponential equations with bases other than 10 or e — which arise frequently in computer science (base 2), information theory, and population modeling (arbitrary growth rates).
A logarithm answers the question: "what exponent do I need?" If 2³ = 8, then log₂(8) = 3. The base (2) raised to the answer (3) produces the argument (8). This inverse relationship with exponents makes logarithms essential wherever exponential processes need to be reversed or linearized. When scientists say an earthquake measured 7.0 on the Richter scale, they mean the seismic amplitude was 10⁷ (10 million) times the reference level — the Richter scale is a base-10 logarithm. A magnitude 8.0 earthquake is not "a little bigger" than 7.0; it releases 31.6 times more energy. Similarly, the decibel scale for sound is logarithmic: 80 dB is 10 times the intensity of 70 dB, not 14% louder. Logarithms compress enormous ranges into manageable numbers, which is why they appear in any field that deals with quantities spanning many orders of magnitude.
Most practical logarithm work uses one of three bases. The common logarithm (log₁₀ or simply "log") uses base 10 and measures orders of magnitude: log(1000) = 3 because 10³ = 1000. Chemistry's pH scale is a common logarithm: pH = -log[H⁺], so a pH of 3 means a hydrogen ion concentration of 10⁻³ = 0.001 moles/liter. The natural logarithm (ln, base e ≈ 2.71828) arises naturally in calculus because the derivative of eˣ is eˣ — a unique self-replicating property. Continuous compound interest, population growth models, radioactive decay, and the normal distribution all use natural logarithms. The binary logarithm (log₂) counts how many times you can halve a number: log₂(256) = 8 because 2⁸ = 256. Computer science uses binary logarithms extensively: a binary search through 1 million sorted items takes at most log₂(1,000,000) ≈ 20 comparisons. Converting between bases uses the change-of-base formula: log₂(x) = ln(x) ÷ ln(2) = log(x) ÷ log(2).
Three fundamental rules govern all logarithm arithmetic. The product rule: log(ab) = log(a) + log(b). This is why slide rules worked — multiplying two numbers meant adding their logarithmic distances on the ruler. The quotient rule: log(a/b) = log(a) - log(b). The power rule: log(a^n) = n × log(a). Together, these rules convert multiplication, division, and exponentiation into addition, subtraction, and multiplication — a simplification that enabled astronomical calculations for centuries before electronic computers. A practical application: to estimate how long it takes an investment to double at r% annual return, use the Rule of 72 (which is a logarithmic approximation): years ≈ 72/r. At 8% return, doubling takes about 9 years. The exact formula is ln(2)/ln(1.08) = 9.006 years — the Rule of 72 is remarkably accurate for rates between 2-20%.
When data spans several orders of magnitude, a linear axis compresses most values into an unreadable cluster near zero while stretching extreme values. Logarithmic axes solve this by spacing each power of 10 equally: 1, 10, 100, 1000 receive equal visual spacing instead of the 1:10:100:1000 proportional spacing a linear axis would give. Stock market indices spanning decades use logarithmic y-axes to show percentage changes proportionally — a move from $100 to $200 (100% gain) occupies the same vertical space as $1,000 to $2,000 (also 100%), which linear axes would show as a tiny early blip followed by enormous later movements. COVID-19 case count charts used logarithmic axes to compare growth rates between countries regardless of absolute numbers: parallel lines on a log-scale chart meant identical growth rates, making it immediately visible which nations were flattening their curves. Any dataset where ratios matter more than absolute differences benefits from logarithmic presentation.
A logarithm answers the question: "what exponent do I need?" If 2³ = 8, then log₂(8) = 3. The base (2) raised to the answer (3) produces the argument (8). This inverse relationship with exponents makes logarithms essential wherever exponential processes need to be reversed or linearized. When scientists say an earthquake measured 7.0 on the Richter scale, they mean the seismic amplitude was 10⁷ (10 million) times the reference level — the Richter scale is a base-10 logarithm. A magnitude 8.0 earthquake is not "a little bigger" than 7.0; it releases 31.6 times more energy. Similarly, the decibel scale for sound is logarithmic: 80 dB is 10 times the intensity of 70 dB, not 14% louder. Logarithms compress enormous ranges into manageable numbers, which is why they appear in any field that deals with quantities spanning many orders of magnitude.
Most practical logarithm work uses one of three bases. The common logarithm (log₁₀ or simply "log") uses base 10 and measures orders of magnitude: log(1000) = 3 because 10³ = 1000. Chemistry's pH scale is a common logarithm: pH = -log[H⁺], so a pH of 3 means a hydrogen ion concentration of 10⁻³ = 0.001 moles/liter. The natural logarithm (ln, base e ≈ 2.71828) arises naturally in calculus because the derivative of eˣ is eˣ — a unique self-replicating property. Continuous compound interest, population growth models, radioactive decay, and the normal distribution all use natural logarithms. The binary logarithm (log₂) counts how many times you can halve a number: log₂(256) = 8 because 2⁸ = 256. Computer science uses binary logarithms extensively: a binary search through 1 million sorted items takes at most log₂(1,000,000) ≈ 20 comparisons. Converting between bases uses the change-of-base formula: log₂(x) = ln(x) ÷ ln(2) = log(x) ÷ log(2).
Three fundamental rules govern all logarithm arithmetic. The product rule: log(ab) = log(a) + log(b). This is why slide rules worked — multiplying two numbers meant adding their logarithmic distances on the ruler. The quotient rule: log(a/b) = log(a) - log(b). The power rule: log(a^n) = n × log(a). Together, these rules convert multiplication, division, and exponentiation into addition, subtraction, and multiplication — a simplification that enabled astronomical calculations for centuries before electronic computers. A practical application: to estimate how long it takes an investment to double at r% annual return, use the Rule of 72 (which is a logarithmic approximation): years ≈ 72/r. At 8% return, doubling takes about 9 years. The exact formula is ln(2)/ln(1.08) = 9.006 years — the Rule of 72 is remarkably accurate for rates between 2-20%.
When data spans several orders of magnitude, a linear axis compresses most values into an unreadable cluster near zero while stretching extreme values. Logarithmic axes solve this by spacing each power of 10 equally: 1, 10, 100, 1000 receive equal visual spacing instead of the 1:10:100:1000 proportional spacing a linear axis would give. Stock market indices spanning decades use logarithmic y-axes to show percentage changes proportionally — a move from $100 to $200 (100% gain) occupies the same vertical space as $1,000 to $2,000 (also 100%), which linear axes would show as a tiny early blip followed by enormous later movements. COVID-19 case count charts used logarithmic axes to compare growth rates between countries regardless of absolute numbers: parallel lines on a log-scale chart meant identical growth rates, making it immediately visible which nations were flattening their curves. Any dataset where ratios matter more than absolute differences benefits from logarithmic presentation.
A logarithm answers the question: "what exponent do I need?" If 2³ = 8, then log₂(8) = 3. The base (2) raised to the answer (3) produces the argument (8). This inverse relationship with exponents makes logarithms essential wherever exponential processes need to be reversed or linearized. When scientists say an earthquake measured 7.0 on the Richter scale, they mean the seismic amplitude was 10⁷ (10 million) times the reference level — the Richter scale is a base-10 logarithm. A magnitude 8.0 earthquake is not "a little bigger" than 7.0; it releases 31.6 times more energy. Similarly, the decibel scale for sound is logarithmic: 80 dB is 10 times the intensity of 70 dB, not 14% louder. Logarithms compress enormous ranges into manageable numbers, which is why they appear in any field that deals with quantities spanning many orders of magnitude.
Most practical logarithm work uses one of three bases. The common logarithm (log₁₀ or simply "log") uses base 10 and measures orders of magnitude: log(1000) = 3 because 10³ = 1000. Chemistry's pH scale is a common logarithm: pH = -log[H⁺], so a pH of 3 means a hydrogen ion concentration of 10⁻³ = 0.001 moles/liter. The natural logarithm (ln, base e ≈ 2.71828) arises naturally in calculus because the derivative of eˣ is eˣ — a unique self-replicating property. Continuous compound interest, population growth models, radioactive decay, and the normal distribution all use natural logarithms. The binary logarithm (log₂) counts how many times you can halve a number: log₂(256) = 8 because 2⁸ = 256. Computer science uses binary logarithms extensively: a binary search through 1 million sorted items takes at most log₂(1,000,000) ≈ 20 comparisons. Converting between bases uses the change-of-base formula: log₂(x) = ln(x) ÷ ln(2) = log(x) ÷ log(2).
Three fundamental rules govern all logarithm arithmetic. The product rule: log(ab) = log(a) + log(b). This is why slide rules worked — multiplying two numbers meant adding their logarithmic distances on the ruler. The quotient rule: log(a/b) = log(a) - log(b). The power rule: log(a^n) = n × log(a). Together, these rules convert multiplication, division, and exponentiation into addition, subtraction, and multiplication — a simplification that enabled astronomical calculations for centuries before electronic computers. A practical application: to estimate how long it takes an investment to double at r% annual return, use the Rule of 72 (which is a logarithmic approximation): years ≈ 72/r. At 8% return, doubling takes about 9 years. The exact formula is ln(2)/ln(1.08) = 9.006 years — the Rule of 72 is remarkably accurate for rates between 2-20%.
When data spans several orders of magnitude, a linear axis compresses most values into an unreadable cluster near zero while stretching extreme values. Logarithmic axes solve this by spacing each power of 10 equally: 1, 10, 100, 1000 receive equal visual spacing instead of the 1:10:100:1000 proportional spacing a linear axis would give. Stock market indices spanning decades use logarithmic y-axes to show percentage changes proportionally — a move from $100 to $200 (100% gain) occupies the same vertical space as $1,000 to $2,000 (also 100%), which linear axes would show as a tiny early blip followed by enormous later movements. COVID-19 case count charts used logarithmic axes to compare growth rates between countries regardless of absolute numbers: parallel lines on a log-scale chart meant identical growth rates, making it immediately visible which nations were flattening their curves. Any dataset where ratios matter more than absolute differences benefits from logarithmic presentation.
A logarithm answers the question: "what exponent do I need?" If 2³ = 8, then log₂(8) = 3. The base (2) raised to the answer (3) produces the argument (8). This inverse relationship with exponents makes logarithms essential wherever exponential processes need to be reversed or linearized. When scientists say an earthquake measured 7.0 on the Richter scale, they mean the seismic amplitude was 10⁷ (10 million) times the reference level — the Richter scale is a base-10 logarithm. A magnitude 8.0 earthquake is not "a little bigger" than 7.0; it releases 31.6 times more energy. Similarly, the decibel scale for sound is logarithmic: 80 dB is 10 times the intensity of 70 dB, not 14% louder. Logarithms compress enormous ranges into manageable numbers, which is why they appear in any field that deals with quantities spanning many orders of magnitude.
Most practical logarithm work uses one of three bases. The common logarithm (log₁₀ or simply "log") uses base 10 and measures orders of magnitude: log(1000) = 3 because 10³ = 1000. Chemistry's pH scale is a common logarithm: pH = -log[H⁺], so a pH of 3 means a hydrogen ion concentration of 10⁻³ = 0.001 moles/liter. The natural logarithm (ln, base e ≈ 2.71828) arises naturally in calculus because the derivative of eˣ is eˣ — a unique self-replicating property. Continuous compound interest, population growth models, radioactive decay, and the normal distribution all use natural logarithms. The binary logarithm (log₂) counts how many times you can halve a number: log₂(256) = 8 because 2⁸ = 256. Computer science uses binary logarithms extensively: a binary search through 1 million sorted items takes at most log₂(1,000,000) ≈ 20 comparisons. Converting between bases uses the change-of-base formula: log₂(x) = ln(x) ÷ ln(2) = log(x) ÷ log(2).
Three fundamental rules govern all logarithm arithmetic. The product rule: log(ab) = log(a) + log(b). This is why slide rules worked — multiplying two numbers meant adding their logarithmic distances on the ruler. The quotient rule: log(a/b) = log(a) - log(b). The power rule: log(a^n) = n × log(a). Together, these rules convert multiplication, division, and exponentiation into addition, subtraction, and multiplication — a simplification that enabled astronomical calculations for centuries before electronic computers. A practical application: to estimate how long it takes an investment to double at r% annual return, use the Rule of 72 (which is a logarithmic approximation): years ≈ 72/r. At 8% return, doubling takes about 9 years. The exact formula is ln(2)/ln(1.08) = 9.006 years — the Rule of 72 is remarkably accurate for rates between 2-20%.
When data spans several orders of magnitude, a linear axis compresses most values into an unreadable cluster near zero while stretching extreme values. Logarithmic axes solve this by spacing each power of 10 equally: 1, 10, 100, 1000 receive equal visual spacing instead of the 1:10:100:1000 proportional spacing a linear axis would give. Stock market indices spanning decades use logarithmic y-axes to show percentage changes proportionally — a move from $100 to $200 (100% gain) occupies the same vertical space as $1,000 to $2,000 (also 100%), which linear axes would show as a tiny early blip followed by enormous later movements. COVID-19 case count charts used logarithmic axes to compare growth rates between countries regardless of absolute numbers: parallel lines on a log-scale chart meant identical growth rates, making it immediately visible which nations were flattening their curves. Any dataset where ratios matter more than absolute differences benefits from logarithmic presentation.
A logarithm answers the question: "what exponent do I need?" If 2³ = 8, then log₂(8) = 3. The base (2) raised to the answer (3) produces the argument (8). This inverse relationship with exponents makes logarithms essential wherever exponential processes need to be reversed or linearized. When scientists say an earthquake measured 7.0 on the Richter scale, they mean the seismic amplitude was 10⁷ (10 million) times the reference level — the Richter scale is a base-10 logarithm. A magnitude 8.0 earthquake is not "a little bigger" than 7.0; it releases 31.6 times more energy. Similarly, the decibel scale for sound is logarithmic: 80 dB is 10 times the intensity of 70 dB, not 14% louder. Logarithms compress enormous ranges into manageable numbers, which is why they appear in any field that deals with quantities spanning many orders of magnitude.
Most practical logarithm work uses one of three bases. The common logarithm (log₁₀ or simply "log") uses base 10 and measures orders of magnitude: log(1000) = 3 because 10³ = 1000. Chemistry's pH scale is a common logarithm: pH = -log[H⁺], so a pH of 3 means a hydrogen ion concentration of 10⁻³ = 0.001 moles/liter. The natural logarithm (ln, base e ≈ 2.71828) arises naturally in calculus because the derivative of eˣ is eˣ — a unique self-replicating property. Continuous compound interest, population growth models, radioactive decay, and the normal distribution all use natural logarithms. The binary logarithm (log₂) counts how many times you can halve a number: log₂(256) = 8 because 2⁸ = 256. Computer science uses binary logarithms extensively: a binary search through 1 million sorted items takes at most log₂(1,000,000) ≈ 20 comparisons. Converting between bases uses the change-of-base formula: log₂(x) = ln(x) ÷ ln(2) = log(x) ÷ log(2).
Three fundamental rules govern all logarithm arithmetic. The product rule: log(ab) = log(a) + log(b). This is why slide rules worked — multiplying two numbers meant adding their logarithmic distances on the ruler. The quotient rule: log(a/b) = log(a) - log(b). The power rule: log(a^n) = n × log(a). Together, these rules convert multiplication, division, and exponentiation into addition, subtraction, and multiplication — a simplification that enabled astronomical calculations for centuries before electronic computers. A practical application: to estimate how long it takes an investment to double at r% annual return, use the Rule of 72 (which is a logarithmic approximation): years ≈ 72/r. At 8% return, doubling takes about 9 years. The exact formula is ln(2)/ln(1.08) = 9.006 years — the Rule of 72 is remarkably accurate for rates between 2-20%.
When data spans several orders of magnitude, a linear axis compresses most values into an unreadable cluster near zero while stretching extreme values. Logarithmic axes solve this by spacing each power of 10 equally: 1, 10, 100, 1000 receive equal visual spacing instead of the 1:10:100:1000 proportional spacing a linear axis would give. Stock market indices spanning decades use logarithmic y-axes to show percentage changes proportionally — a move from $100 to $200 (100% gain) occupies the same vertical space as $1,000 to $2,000 (also 100%), which linear axes would show as a tiny early blip followed by enormous later movements. COVID-19 case count charts used logarithmic axes to compare growth rates between countries regardless of absolute numbers: parallel lines on a log-scale chart meant identical growth rates, making it immediately visible which nations were flattening their curves. Any dataset where ratios matter more than absolute differences benefits from logarithmic presentation.
→ log answers: 10^what = x? Core concept.
→ ln for calculus. Continuous growth, derivatives, integrals.
→ log2 for CS. Binary search, tree depth, bits.
→ Change of base converts any log. To a base your calculator supports.
See also: Exponent · Scientific · Compound Interest