Logarithm Calculator: Complete Guide to Log, Ln, Log Rules, Change of Base, and Real-World Applications
Logarithms are among the most powerful and far-reaching concepts in mathematics. Invented independently by John Napier in 1614 and Joost Bürgi in 1620 to simplify astronomical calculations, logarithms transform multiplication into addition, division into subtraction, and exponentiation into multiplication. Today they appear in virtually every branch of science, engineering, and technology — from measuring earthquake intensity and sound volume to analyzing algorithm complexity and modeling population growth. This calculator computes logarithms in any base with full precision, displays an interactive multi-curve graph, and provides step-by-step solutions with antilog verification.
What Is a Logarithm?
A logarithm answers the question: what exponent do I need? Formally, log_b(x) = y means b^y = x. In words: the logarithm base b of x is the power to which b must be raised to produce x. For example, log₁₀(1000) = 3 because 10³ = 1000, and log₂(64) = 6 because 2⁶ = 64. The logarithm is the inverse function of exponentiation: if f(x) = b^x, then f⁻¹(x) = log_b(x). This inverse relationship is central to solving exponential equations and understanding exponential growth and decay.
Common Bases:
ln(x) = log₂e(x), e ≈ 2.71828
log(x) = log₁₀(x) [common log]
log₂(x) [binary log]
Change of Base:
log₂b(x) = ln(x) / ln(b) = log(x) / log(b)
Key Values:
log₂b(1) = 0, log₂b(b) = 1
log₂b(b^n) = n
b^(log₂b(x)) = x
The Three Main Logarithm Bases
Three bases dominate practical use. The common logarithm (log₁₀ or simply log) uses base 10 and is standard in engineering, chemistry (pH), acoustics (decibels), and seismology (Richter scale). The natural logarithm (ln) uses base e ≈ 2.71828 and is fundamental in calculus — it is the only logarithm whose derivative is simply 1/x. The binary logarithm (log₂) uses base 2 and dominates computer science, where everything is binary: bits, bytes, tree depths, and algorithmic complexity (O(log n) means base 2). Our graph overlays all three curves simultaneously so you can visually compare how different bases affect the logarithmic curve shape.
Logarithm Rules and Properties
Logarithms obey elegant algebraic rules that make them powerful computational tools. The product rule: log(ab) = log(a) + log(b). The quotient rule: log(a/b) = log(a) − log(b). The power rule: log(a^n) = n · log(a). The change of base: log_b(x) = log_c(x) / log_c(b). Additionally, log(1) = 0 for any base, and log_b(b) = 1. These rules explain why logarithms were historically used for computation: multiplying large numbers becomes adding their logarithms, which is much simpler. Slide rules, used by engineers for centuries before electronic calculators, were based entirely on logarithmic scales.
The Logarithmic Curve
The graph of y = log_b(x) has distinctive properties visible in our interactive visualization. The curve passes through (1, 0) for every base because b⁰ = 1. It passes through (b, 1) because b¹ = b. The curve approaches negative infinity as x approaches 0 from the right — the y-axis is a vertical asymptote. The function is defined only for x > 0 (you cannot take the logarithm of zero or negative numbers in real numbers). For base b > 1, the curve increases but decelerates — logarithmic growth is famously slow. For 0 < b < 1, the curve decreases. The larger the base, the more compressed the curve.
Logarithms in Science and Engineering
Logarithmic scales compress enormous ranges into manageable numbers. The Richter scale measures earthquake magnitude: each whole number increase represents a 10× increase in amplitude (a magnitude 7 quake is 1000× stronger than magnitude 4). The decibel scale measures sound intensity: dB = 10 log₁₀(I/I₀), so 60 dB is 1,000,000× the threshold intensity. The pH scale measures acidity: pH = −log₁₀[H⁺], covering a factor of 10¹⁴ in hydrogen ion concentration. In electronics, signal-to-noise ratios and filter responses use decibels. In astronomy, stellar magnitude is logarithmic: a difference of 5 magnitudes equals a factor of 100 in brightness.
Logarithms in Computer Science
Binary logarithms are ubiquitous in computing. Binary search finds an element in a sorted array of n items in O(log₂ n) steps — searching 1 billion items takes only about 30 comparisons. Balanced binary trees have height log₂ n. The number of bits needed to represent n distinct values is ⌈log₂ n⌉ (ceiling). Merge sort and quicksort run in O(n log n) time. Information entropy, measured in bits, uses log₂: H = −Σ pᵢ log₂(pᵢ). When a computer scientist says "log n" without specifying a base, they almost always mean log₂. Understanding logarithmic complexity is essential for analyzing and designing efficient algorithms.
Natural Logarithm and Calculus
The natural logarithm holds a unique position in calculus. Its derivative is the simplest of all logarithms: d/dx[ln(x)] = 1/x. Its integral is equally elegant: ∫(1/x)dx = ln|x| + C. The Taylor series expansion is ln(1+x) = x − x²/2 + x³/3 − x⁴/4 + ... for |x| ≤ 1. The base e itself emerges from the limit lim(n→∞)(1+1/n)^n and appears in compound interest (continuous compounding yields e^(rt)), radioactive decay (N = N₀e^(−λt)), and the normal distribution (the bell curve contains e^(−x²)). The natural logarithm is truly "natural" because it arises organically from the structure of calculus.
How to Use This Calculator
Select a base: ln (e), log₁₀, log₂, or enter a custom base. Type any positive number and click calculate. The interactive graph shows your logarithm curve (thick blue) alongside comparison curves in other bases (amber for ln, purple for log₁₀), with your computed point highlighted in green. Drag the graph to pan, scroll to zoom, and hover to see live coordinate tooltips. The calculator displays all base conversions simultaneously, verifies the result via antilog (b^y = x), and shows characteristic + mantissa decomposition. The reference table covers values from 0.01 to 10000.