Logarithm Calculator

Compute logarithms for any base (positive ≠1). Visualize the logarithmic curve \( y = \log_b(x) \), evaluate natural logs (ln), common logs (log₁₀), binary logs (log₂), and apply the change-of-base formula.

b > 0, b ≠ 1. Use "e" for natural logarithm.
x must be positive.
 
? log₁₀(100) = 2
? ln(20) ≈ 2.9957
? log₂(8) = 3
? log₃(9) = 2
? log₁₀(0.001) = -3
⭐ log₅(125) = 3
? log(1000) = 3
Privacy first: All calculations and graph rendering happen locally in your browser. No data is transmitted.

Understanding Logarithms: The Inverse of Exponentiation

A logarithm answers: “What exponent yields a given number?” If \( b^y = x \), then \( \log_b(x) = y \). Logarithms transform multiplicative relationships into additive ones, making them essential in science, engineering, and data analysis.

\( \log_b(x) = y \quad \Longleftrightarrow \quad b^y = x \)
where \( b > 0,\ b \neq 1,\ x > 0 \)

Historical Roots: Napier & the Power of Simplification

John Napier introduced logarithms in 1614 as a way to simplify complex astronomical calculations. By converting multiplication into addition, logarithms enabled rapid computation for centuries — a breakthrough that paved the way for the slide rule and modern computing. Today, the natural logarithm (ln) with base \(e\) (≈2.71828) dominates calculus and continuous growth models, while common log (log₁₀) and binary log (log₂) are staples in engineering and computer science.

How the Calculator Works

Our tool uses the change‑of‑base formula internally: \( \log_b(x) = \frac{\ln(x)}{\ln(b)} \). It first validates that base > 0, base ≠ 1, and argument > 0, then computes using JavaScript’s natural logarithm. The step‑by‑step panel shows the exact division, and the graph dynamically plots \( y = \log_b(x) \) over a range that includes your point. The red marker highlights the evaluated coordinate.

Real‑World Applications

  • pH Chemistry: \( \text{pH} = -\log_{10}[H^+] \) — a logarithmic scale for acidity.
  • Decibels (Sound): \( L = 10 \log_{10}(I/I_0) \) — measures sound intensity relative to threshold.
  • Richter Scale: Earthquake magnitude \( M = \log_{10}(A/A_0) \) — each unit represents a tenfold increase in amplitude.
  • Information Theory: Entropy uses \( \log_2 \) to measure information in bits.
  • Finance: Doubling time \( t = \frac{\ln 2}{\ln(1+r)} \) for continuous compounding.
Case Study: Decibels & Jet Engines

A jet engine produces sound intensity \(10^{12}\) times the reference intensity (\(I_0\)). The decibel level is \(10 \log_{10}(10^{12}) = 120\) dB. Using our calculator, evaluate \( \log_{10}(10^{12}) \) — the result is exactly 12, confirming the scale. This demonstrates how logarithms compress vast ranges into manageable numbers.

Key Logarithmic Properties

Property Formula Example
Product Rule \(\log_b(xy) = \log_b x + \log_b y\) \(\log_2(8 \cdot 4) = 3+2=5\)
Quotient Rule \(\log_b(x/y) = \log_b x - \log_b y\) \(\log_3(81/9) = 4-2=2\)
Power Rule \(\log_b(x^k) = k \log_b x\) \(\ln(e^5) = 5\)
Change of Base \(\log_b x = \frac{\log_k x}{\log_k b}\) \(\log_{16}4 = \frac{\ln 4}{\ln 16} = 0.5\)
Base Identity \(b^{\log_b x} = x\) \(10^{\log_{10}100} = 100\)

Common Misconceptions Clarified

  • “Log of a negative number is defined.” — In real numbers, logarithms are only defined for positive arguments. The calculator will reject x ≤ 0.
  • “Base can be any number.” — Base must be positive and not equal to 1. Negative bases lead to complex results not covered here.
  • “Log of 1 is always 0.” — True for any valid base: \(b^0 = 1\).
  • “Larger base gives larger logarithm.” — Not for x < 1; for example, \(\log_{10}(0.1) = -1\), while \(\log_2(0.1) \approx -3.32\).

Interactive Graph Insights

The graph displays \(y = \log_b(x)\) for your chosen base. Notice the curve always passes through (1,0), increases for b>1, decreases for 0

Frequently Asked Questions

If base = 1, the function is constant (1^x = 1), making the logarithm undefined for x ≠ 1. Negative bases produce non‑real results for most x (e.g., log_{−2}(8) is not real).

ln denotes natural logarithm (base e). In many contexts, “log” without a base means base 10, but in pure mathematics it often means natural log. Our calculator lets you specify any base explicitly.

Enter base = 2, argument = 5. The calculator uses change of base: ln(5)/ln(2) ≈ 2.321928. The steps will show the exact division.

Yes, arguments less than 1 yield negative results. Example: log₁₀(0.01) = -2, as shown in our example buttons.

JavaScript’s double‑precision floating point gives about 15 significant digits. Results are displayed rounded to 6–10 decimals for readability, but the internal precision is high.

Mathematical rigor & educational depth — This tool was developed by the GetZenQuery Tech team, referencing authoritative works such as "A History of Mathematics" by Boyer and "The Princeton Companion to Mathematics." Every formula is validated against standard implementations. Interactive graph uses adaptive scaling to improve pedagogical clarity.

References: Napier, J. (1614) Mirifici Logarithmorum Canonis Descriptio; Boyer, C. A History of Mathematics; NIST Digital Library of Mathematical Functions; Wolfram MathWorld – Logarithm.