Logarithm Calculator

The logarithm of a number x with base b answers the question: what exponent must b be raised to in order to produce x? Formally, log_b(x) = n means b^n = x. For instance, log_10(1000) = 3 because 10^3 = 1000, and ln(e^5) = 5 because the natural log uses base e (approximately 2.71828). This calculator provides three modes: common logarithm (base 10), natural logarithm (base e), and custom base logarithm using the change-of-base formula log_b(x) = ln(x) / ln(b).

Quick Answer

log base 10 of 1000 is 3. The natural logarithm of 20 is approximately 2.9957.

Common Logarithm (Base 10)

Natural Logarithm (Base e)

Custom Base Logarithm

Common Examples

Input Result
log10(1000) 3
ln(20) 2.9957
log2(256) 8
log10(50) 1.699
log5(625) 4

How It Works

The Formula

A logarithm is the inverse of exponentiation. If b^n = x, then:

log_b(x) = n

In words: the logarithm base b of x is the exponent n to which b must be raised to produce x.

Common Logarithm (log or log10): Uses base 10. Widely used in science, engineering, and the decibel scale. log_10(100) = 2 because 10^2 = 100.

Natural Logarithm (ln): Uses base e (approximately 2.71828). Euler’s number e is the base of natural exponential growth and appears throughout calculus, physics, and finance. ln(e) = 1 because e^1 = e.

Change-of-Base Formula: To compute a logarithm with any base using the natural log (or any other base):

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

This formula works because if log_b(x) = n, then b^n = x, and taking ln of both sides gives n * ln(b) = ln(x), so n = ln(x) / ln(b).

Key Logarithm Properties

  • Product rule: log_b(x * y) = 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)
  • Identity: log_b(b) = 1 and log_b(1) = 0

Worked Example

To find log_2(256): using the change-of-base formula, log_2(256) = ln(256) / ln(2) = 5.5452 / 0.6931 = 8. This checks out because 2^8 = 256.

To find log_10(50): log_10(50) = ln(50) / ln(10) = 3.912 / 2.3026 = 1.699. Verification: 10^1.699 = 50.

To find ln(100): ln(100) = 4.6052. Verification: e^4.6052 = 100.

Related Calculators

Frequently Asked Questions

Why is the logarithm undefined for zero and negative numbers?
No positive base raised to any real power can produce zero or a negative number. For example, 10^n is always positive regardless of n. Therefore log_b(0) and log_b(-x) have no real solution. In complex analysis, logarithms of negative numbers do exist using imaginary numbers, but this calculator works with real numbers only.
What is the difference between log and ln?
Log (without a subscript) typically means log base 10 (the common logarithm), while ln means the natural logarithm with base e (approximately 2.71828). In some pure mathematics and computer science contexts, log may refer to the natural logarithm or log base 2, so context matters.
Why is the natural logarithm important?
The natural logarithm (ln) is mathematically fundamental because its base, e, is the unique number whose exponential function equals its own derivative: d/dx(e^x) = e^x. This property makes ln appear naturally in calculus, differential equations, compound interest with continuous compounding, radioactive decay, and many other fields.
What is the change-of-base formula?
The change-of-base formula converts a logarithm from one base to another: log_b(x) = log_c(x) / log_c(b), where c is any convenient base. Most calculators only provide log base 10 and ln, so this formula lets you compute logarithms with any base using either of those.
Where are logarithms used in real life?
Logarithms appear in the Richter scale for earthquake magnitude, the decibel scale for sound intensity, pH for acidity, information theory (bits and entropy), algorithmic complexity in computer science (binary search runs in O(log n) time), and finance for computing how long it takes an investment to double.