Logarithm Calculator

Calculate log, ln, and logarithms in any base — including antilog

Logarithm Calculator

Calculate logarithms with any base

Logarithm Calculator

Calculate log base b of x

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

What is a Logarithm Calculator?

A Logarithm Calculator is a math tool that computes logarithms, which answer the question: "What power do I raise a base to in order to get a number?" For example, if 10³ = 1000, then log₁₀(1000) = 3. The logarithm tells you the exponent (power) needed to turn 10 into 1000.

Logarithms are widely used in math and science because they help work with very large or very small numbers, convert multiplication into addition, and model real-world growth and decay. They appear in fields like chemistry (pH), finance (compound growth), engineering, computer science, and statistics.

This calculator computes all three major types of logarithms simultaneously:

Supported Logarithm Types

  • Common logarithm (base 10) -- log₁₀(x), often written as log(x)
  • Natural logarithm (base e) -- ln(x), where e ≈ 2.71828
  • Custom base logarithm -- log₂(x) -- enter any valid base b to compute log_b(x)

How to Use This Logarithm Calculator

  1. Enter the number (x) -- the value you want to take the logarithm of
  2. Enter the base (b) -- defaults to 10, but you can change it to any valid base (e.g., 2, e, 5)
  3. Click "Calculate" -- to compute the logarithm
  4. Review all three results -- the calculator shows log_b(x), ln(x), and log₁₀(x) simultaneously
  5. Use the result -- apply it in your equation, problem, or real-world calculation

Tips:

  • For real-number results, the input x must be greater than 0
  • The base b must be greater than 0 and b ≠ 1
  • If your result looks unexpected, double-check whether you need log (base 10) vs ln (base e)

Logarithm Formulas

Definition of a Logarithm

log_b(x) = y means bʸ = x

The logarithm returns the exponent y that makes bʸ equal to x

Common Logarithm

log₁₀(x)

Base 10, often written as log(x)

Natural Logarithm

ln(x)

Base e, where e ≈ 2.71828

Change of Base Formula

Compute any base using log base 10 or ln:

log_b(x) = ln(x) / ln(b) = log₁₀(x) / log₁₀(b)

Convert between any bases using this identity

Useful Logarithm Rules

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ᵏ) = k × log_b(x)

Log of 1 / Log of Base

log_b(1) = 0

log_b(b) = 1

Example Calculations

Example 1: Common Log (Base 10)

Compute: log₁₀(1000)

Reasoning: 10³ = 1000

Result: 3

Example 2: Natural Log (Base e)

Compute: ln(e²)

Reasoning: ln returns the exponent when the base is e

Result: 2

Example 3: Custom Base Log

Compute: log₂(32)

Reasoning: 2⁵ = 32

Result: 5

Example 4: Using the Change of Base Formula

Compute: log₅(125)

Direct reasoning: 5³ = 125, so log₅(125) = 3

Change of base: ln(125) / ln(5) = 4.8283 / 1.6094 = 3

Result: 3

Frequently Asked Questions

What's the difference between log and ln?

log(x) usually means base 10 (common log), while ln(x) means base e (natural log). They're both logarithms—just with different bases.

Why can't I take the logarithm of 0 or a negative number?

In real-number math, log values are only defined for x > 0. There is no real exponent that makes a positive base equal 0 or a negative number.

What base values are allowed?

The base must be greater than 0 and not equal to 1. A base of 1 would always equal 1 for any exponent, so it can't produce different outputs.

What does a logarithm output represent?

The output is the exponent. If log_b(x) = y, then bʸ = x. That's the core meaning of logarithms.

When are logarithms useful in real life?

Logs are used when quantities change multiplicatively or span wide ranges: pH in chemistry, earthquake magnitude scales, sound intensity (decibels), compound growth/interest, and many scientific models.

Embed This Logarithm Calculator on Your Website

Want to add this logarithm calculator to your website? Get a custom embed code that matches your site's design and keeps visitors engaged.

Responsive design
Custom styling
Fast loading
Mobile optimized

What Is a Logarithm?

A logarithm answers the question: to what power must we raise the base to get this number? For example, log₁₀(1000) = 3 because 10³ = 1000. Logarithms turn multiplication into addition, making massive calculations far more manageable. They appear throughout science, engineering, music theory, and computer science — anywhere humans need to work with numbers that span many orders of magnitude.

The two most common logarithms are log base 10 (written simply as "log") and the natural log (base e ≈ 2.71828, written "ln"). This calculator handles any base you need — including log₂, which is essential in computer science for counting bits and measuring information. You can also compute antilogarithms, which reverse the process and raise a base to a given power.

How to Use the Logarithm Calculator

  1. Enter the number you want to take the logarithm of (must be a positive number greater than zero).
  2. Select the base: 10 for common log, e for natural log (ln), 2 for binary log, or enter a custom base.
  3. Click Calculate to see your result instantly.
  4. For antilogarithm: enter the exponent value, select the same base, and the calculator returns the original number (b^y).

Logarithm Formulas & Key Identities

Definition: log_b(x) = y means b^y = x Common log: log(x) = log_10(x) Natural log: ln(x) = log_e(x) Binary log: log_2(x) Change of base: log_b(x) = ln(x) / ln(b) Antilog: antilog_10(y) = 10^y Anti-ln: e^y Key identities: log(a × b) = log(a) + log(b) log(a / b) = log(a) − log(b) log(a^n) = n × log(a)

Special values: ln(e) = 1, log(10) = 1, and log(1) = 0 for any base. Logarithms are only defined for positive numbers — log(0) and log of a negative number are undefined.

Worked Examples

log₁₀(1000) = 3

We ask: 10 to what power equals 1000? Since 10³ = 1000, the answer is 3. This is why the common log of powers of 10 always gives a clean integer.

ln(e²) = 2

The natural log undoes the exponential function. Since ln and e are inverses, ln(e²) = 2 exactly. This identity is fundamental in calculus and differential equations.

log₂(32) = 5

We ask: 2 to what power equals 32? Since 2⁵ = 32, the answer is 5. Log base 2 is widely used in computer science — for example, a 32-bit address space requires log₂(2³²) = 32 bits.

Frequently Asked Questions

What is a logarithm in simple terms?
A logarithm is just the reverse of an exponent. If 2³ = 8, then log₂(8) = 3. You're asking: what exponent do I need to raise this base to in order to get my number? That's all a logarithm does — it finds the missing exponent.
What's the difference between log and ln?
"Log" without a written base almost always means log base 10 (the common logarithm), used in engineering, chemistry, and everyday science. "Ln" is the natural logarithm with base e ≈ 2.71828, and it appears naturally in calculus, continuous growth models, and physics. Both measure the same concept — just with different bases.
When should I use log₂ (binary log)?
Log base 2 is the go-to choice in computer science and information theory. It tells you how many bits are needed to represent a number, how many comparisons a binary search takes, or the depth of a balanced binary tree. If you're working with powers of 2, algorithms, or digital data, log₂ is your friend.
Why is the logarithm of 0 or a negative number undefined?
No real power of a positive base can ever produce zero or a negative number. For example, 10^x is always positive for any real x, and it can only approach zero as x → −∞ but never actually reach it. Because there's no real exponent that satisfies b^y = 0 or b^y < 0, logarithms of non-positive numbers don't exist in the real numbers.
How are logarithms used in decibels and pH?
Both scales use log₁₀ to compress enormous ranges into human-friendly numbers. The decibel scale measures sound intensity: dB = 10 × log₁₀(I/I₀), so every 10 dB increase means 10× the intensity. pH measures acidity: pH = −log₁₀([H⁺]), so pH 3 is 10× more acidic than pH 4. Logarithms make these wildly different quantities easy to compare and communicate.