ES EN FR PT DE IT

Logarithm Calculator

Calculate the logarithm of a number in any base.

The Logarithm Calculator is a free online math calculator. Calculate the logarithm of a number in any base. Get instant results with the detailed formula and step-by-step examples.
Inputs
Values
Technical Parameters
Result
Enter values and press Calculate

What is a Logarithm?

A logarithm answers the question: "To what power must I raise a base number to get another number?" For example, log₂(8) = 3 because 2³ = 8. Logarithms transform multiplication into addition, making complex calculations manageable. This calculator computes logarithms for any base from 2 to 100, showing you exactly how the exponent relates to your input values.

Logarithms were invented by John Napier in 1614 to simplify astronomical calculations. Before computers, scientists used logarithm tables to multiply large numbers by adding their logs instead. Today, logarithms remain essential in computer science (binary search is O(log n)), acoustics (decibels), chemistry (pH scale), and seismology (Richter scale).

The logarithm formula is log_b(x) = y, which means b^y = x. If you know the base b and the result x, the logarithm gives you the exponent y. For example, log₁₀(1000) = 3 because 10³ = 1000.

Formulas Explained

The calculator uses the change-of-base formula to compute logarithms for any base:

log_b(x) = ln(x) / ln(b)

Where ln represents the natural logarithm (base e ≈ 2.718). This formula works because logarithms of different bases are proportional to each other.

Key logarithm properties:

  • Product rule: log_b(xy) = log_b(x) + log_b(y)
  • Quotient rule: log_b(x/y) = log_b(x) - log_b(y)
  • Power rule: log_b(x^n) = n × log_b(x)
  • log_b(1) = 0 for any base b
  • log_b(b) = 1 for any base b

Step-by-Step Guide

  1. Enter the number (x): This is the value you want to find the logarithm of. Must be positive (greater than 0). Example: 1000
  2. Enter the base (b): This is the base of the logarithm. Common bases are 2 (binary), 10 (common log), and e (natural log). Example: 10
  3. Click calculate: The calculator applies log_b(x) = ln(x) / ln(b)
  4. Read your result: For log₁₀(1000), the result is exactly 3
  5. Verify: Check by computing b^result = x. For our example: 10³ = 1000 ✓

Real Examples with Calculations

Example 1: Binary logarithm (computer science)
Find log₂(256): How many bits needed to represent 256 values?
log₂(256) = ln(256) / ln(2) = 5.545 / 0.693 = 8
Verification: 2⁸ = 256 ✓
Application: You need 8 bits (1 byte) to store values 0-255.

Example 2: Common logarithm (scientific notation)
Find log₁₀(500): What power of 10 equals 500?
log₁₀(500) = ln(500) / ln(10) = 6.215 / 2.303 = 2.699
Verification: 10^2.699 ≈ 500 ✓
Application: 500 = 10^2.699 = 5 × 10² in scientific notation.

Example 3: pH calculation (chemistry)
If [H⁺] = 0.0001 mol/L, what is the pH?
pH = -log₁₀(0.0001) = -log₁₀(10⁻⁴) = -(-4) = 4
Application: pH 4 indicates an acidic solution (like tomato juice).

Example 4: Decibel calculation (acoustics)
Sound intensity ratio of 1000:1, what is the dB level?
dB = 10 × log₁₀(1000) = 10 × 3 = 30 dB
Application: A 30 dB increase represents a 1000× intensity change (whisper to library).

Example 5: Richter scale (seismology)
Earthquake A has amplitude 10,000× the reference. Magnitude?
M = log₁₀(10000) = 4
Application: Magnitude 4.0 earthquake (light shaking, noticeable indoors).

4 Common Mistakes

  • Trying to calculate log of zero or negative numbers: Logarithms are only defined for positive real numbers. log(0) is undefined (approaches -∞), and log(-5) has no real solution.
  • Confusing log base: log₂(8) = 3, but log₁₀(8) = 0.903, and ln(8) = 2.079. Always verify which base you need for your application.
  • Misapplying the product rule: log(x + y) ≠ log(x) + log(y). The product rule only works for multiplication: log(xy) = log(x) + log(y).
  • Forgetting to divide by ln(base): When using calculators that only have ln or log₁₀, remember log_b(x) = ln(x)/ln(b), not just ln(x).

4 Pro Tips

  • Use log properties to estimate: If you know log₁₀(2) ≈ 0.301, then log₁₀(200) = log₁₀(2×100) = 0.301 + 2 = 2.301. Mental math becomes easier.
  • Recognize common values: Memorize log₁₀(2) ≈ 0.301, log₁₀(3) ≈ 0.477, log₂(10) ≈ 3.322. These appear frequently in engineering and CS.
  • Check reasonableness: For base 10, log₁₀(1) = 0, log₁₀(10) = 1, log₁₀(100) = 2. Your result should fall between these benchmarks.
  • Use logarithmic scales for wide ranges: When data spans orders of magnitude (like earthquake energies from 10⁴ to 10¹⁸ joules), plot on a log scale to visualize everything clearly.

FAQs

The natural logarithm uses base e ≈ 2.71828, Euler's number. It appears naturally in growth/decay problems, calculus (derivative of ln(x) is 1/x), and continuous compounding. ln(x) = log_e(x).

For real numbers, no exponent of a positive base produces a negative result. 2^y is always positive for any real y. However, complex logarithms of negative numbers exist using imaginary numbers.

Use log₂ in computer science (binary trees, data structures, information theory in bits). Use log₁₀ in science/engineering (scientific notation, pH, decibels, Richter scale). Use ln (base e) in calculus and continuous growth models.

Logarithms are inverse functions of exponentials. If y = b^x, then x = log_b(y). Graphically, they reflect across the line y = x. This relationship solves equations like 2^x = 100 by taking logs of both sides.

Explore our mathematics and science calculators: Natural Logarithm Calculator, Exponential Growth Calculator, Projectile Motion Calculator, Percentage Calculator, Quadratic Polynomial Derivative Calculator.

Written and reviewed by the CalcToWork editorial team. Last updated: 2026-04-29.

Frequently Asked Questions

The natural logarithm uses base e ≈ 2.71828, Euler's number. It appears naturally in growth/decay problems, calculus (derivative of ln(x) is 1/x), and continuous compounding. ln(x) = log_e(x).
For real numbers, no exponent of a positive base produces a negative result. 2^y is always positive for any real y. However, complex logarithms of negative numbers exist using imaginary numbers.
Use log₂ in computer science (binary trees, data structures, information theory in bits). Use log₁₀ in science/engineering (scientific notation, pH, decibels, Richter scale). Use ln (base e) in calculus and continuous growth models.
Logarithms are inverse functions of exponentials. If y = b^x, then x = log_b(y). Graphically, they reflect across the line y = x. This relationship solves equations like 2^x = 100 by taking logs of both sides.