Language
English English Vietnamese (Tiếng Việt) Vietnamese (Tiếng Việt) Chinese (简体中文) Chinese (简体中文) Portuguese (Brazil) (Português do Brasil) Portuguese (Brazil) (Português do Brasil) Spanish (Español) Spanish (Español) Indonesian (Bahasa Indonesia) Indonesian (Bahasa Indonesia)
Logarithm Calculator

Logarithm Calculator

Calculate logarithms in three bases: common (log₁₀), natural log (ln), and binary (log₂). Enter any positive number for instant, high-precision results.

What Is a Logarithm?

A logarithm answers one question: what power must you raise a base to in order to reach a given number? This logarithm calculator computes the three bases you meet most often — the common log (base 10), the natural log (ln, base e), and the binary log (base 2) — the instant you type. Enter any positive value, pick a base, and read a high-precision result with no submit step.

Definition: the logarithm is the inverse of exponentiation. If bˣ = y, then log_b(y) = x. For example, log₁₀(100) = 2 because 10² = 100.

The Three Bases

log₁₀ — Common Log

Base 10, used in scientific scales such as pH, decibels, and the Richter scale.

ln — Natural Log

Base e (≈ 2.718), the backbone of calculus, growth and decay, and continuous compounding.

log₂ — Binary Log

Base 2, central to computer science, information theory, and algorithm complexity.

How to Calculate a Logarithm

1

Choose the Base

Pick log₁₀, ln, or log₂ from the type selector. The formula line updates to match your choice, so you always see the expression you are solving.

2

Enter a Positive Number

Type any value greater than zero. Logarithms are undefined for zero and negative numbers, so only positive inputs return a result.

3

Read the Result

The answer appears instantly as you type, shown to up to 10 decimal places with trailing zeros trimmed for a clean value.

Positive inputs only: the log of zero tends to negative infinity, and the log of a negative number is undefined in the real numbers.
Private by design: every calculation runs in your browser — nothing you type is uploaded to a server.

Features

Three Bases in One

Switch freely between log₁₀, ln, and log₂ without leaving the page.

Real-Time Calculation

Results update the instant you type — no button to press.

Live Formula Preview

The expression line (for example log₁₀(100) =) mirrors your base and input.

High Precision

Up to 10 decimal places, accurate for round numbers and awkward decimals alike.

Common Logarithm Values

ExpressionResultWhy
log₁₀(10)110¹ = 10
log₁₀(100)210² = 100
ln(e)1e¹ = e
ln(1)0e⁰ = 1
log₂(2)12¹ = 2
log₂(8)32³ = 8

Frequently Asked Questions

How do I calculate a logarithm?

Choose a base (log₁₀, ln, or log₂), enter a positive number, and the result appears instantly. Mathematically, log_b(y) asks "to what power must I raise b to get y?" — so log₁₀(100) = 2 because 10² = 100.

What is the difference between log, ln, and log₂?

They differ only in the base. "log" usually means the common logarithm with base 10, "ln" is the natural logarithm with base e (≈ 2.718), and "log₂" is the binary logarithm with base 2. The same input gives a different value for each base.

Can you take the log of a negative number or zero?

No. For any positive base, raising it to a real power always yields a positive result, so no real exponent produces zero or a negative number. That is why this calculator accepts positive inputs only and flags anything else.

How does the change-of-base formula work?

To find a logarithm in any base b, divide two logs that share a common base: log_b(x) = ln(x) / ln(b) = log₁₀(x) / log₁₀(b). It lets you compute an unusual base from the common or natural log this tool already provides.

What is log base 2 used for?

The binary logarithm counts how many times you can halve a value. It measures bits of information and expresses the complexity of algorithms such as binary search and merge sort, which is why it appears throughout computer science.

log₁₀(x) = ?
-
n! = ?
-
Calculation Steps
|x| = ?
-
0
round()
Nearest
-
floor()
Round Down
-
ceil()
Round Up
-
trunc()
Truncate
-
mod
a mod b = ?
-
Explanation
Enter any number greater than zero to calculate
log₁₀ — Common logarithm (base 10)
ln — Natural logarithm (base e ≈ 2.718)
log₂ — Binary logarithm (base 2)
Results show up to 10 decimal places with trailing zeros trimmed
Want to learn more? Read documentation →
1/6
Start typing to search...
Searching...
No results found
Try searching with different keywords