Skip to main content
HSCalculadora

Logarithm Calculator

Calculate the logarithm of any number to any base, including natural log (ln) and log base 10.

Use 10 for log₁₀, 2.71828 (e) for ln, or 2 for log₂

Results update as you type.

log_b(x)
—

How it works

The logarithm is the inverse operation of exponentiation. If 10^3 = 1000, then log₁₀(1000) = 3. If 2^8 = 256, then log₂(256) = 8. Logarithms answer the question: 'What exponent do I need to raise base b to, in order to get x?' Three logarithms are especially common. Log base 10 (common log, log₁₀ or just 'log') is used in pH scales, the Richter scale for earthquakes, and decibels for sound. Natural log (ln, log base e where e ≈ 2.718) appears throughout calculus, physics, and the mathematics of growth and decay — interest, population, radioactive decay all involve natural logs. Log base 2 (log₂) is fundamental to information theory and computer science — binary systems, data compression, and algorithm complexity (O(log n)) all use log₂. The change-of-base formula (log_b(x) = ln(x)/ln(b)) allows any logarithm to be computed using the natural log or common log, which is how calculators and computers implement it. Before electronic calculators, logarithms were the fastest way to multiply large numbers by hand: printed log tables and the slide rule turned multiplication into simple addition. That same inverse relationship with exponents is why the logarithm remains the natural tool for solving any equation where the unknown sits in the exponent, from carbon dating to compound-interest problems.

Formula

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

A logarithm reverses exponentiation, so log_b(x) is the exponent that turns the base b into x — that is why b raised to log_b(x) returns x. Calculators rarely store a table for every base, so the change-of-base formula rewrites the logarithm as a ratio of two logs in a base they do know, usually natural log or base 10. Dividing ln(x) by ln(b) cancels the shared base and leaves the answer.

Source:Standard mathematical definition

We review all our tools from time to time to ensure accuracy.

Worked example

Value (x):1000Base:10
log₁₀(1000) = 3 because 10³ = 1,000. The common logarithm of 1,000 is 3. This is why the pH scale spans from 0 to 14 with each step representing a 10× difference in acidity.

How to use this calculator

  1. 1

    Enter your values

    Enter value (x) and base.

  2. 2

    Adjust the options

    Fine-tune any options to match your situation.

  3. 3

    Read your result

    log_b(x) updates instantly as you type — no button to press.

Frequently asked questions

What is the natural logarithm (ln) and why is it special?

The natural logarithm uses the mathematical constant e (≈ 2.71828) as its base. What makes e special is that it's the unique number where the function e^x has a derivative equal to itself — it models continuous growth and decay perfectly. The natural log appears in compound interest (when compounded continuously), probability distributions (normal distribution, Poisson), entropy in information theory, and countless physics equations. While log base 10 is convenient for human calculation, ln is the 'natural' choice mathematically and scientifically.

Why does log of a negative number not exist (in real numbers)?

No real number exponent can make a positive base produce a negative result. Since b^x is always positive for positive b (e.g., 10^x is always positive), there's no real x such that b^x = negative number. Therefore, the logarithm of a negative number is undefined in real numbers. In complex number mathematics, logarithms of negative numbers can be defined (using complex exponents), but for everyday calculations, log(x) requires x > 0. Attempting log(0) is also undefined — it would require an exponent of −∞.

How do logarithmic scales work in the real world?

Logarithmic scales compress large ranges into manageable numbers. The Richter scale: each step is 10× more energy — a magnitude 7 earthquake is 10× stronger than magnitude 6, and 1,000× stronger than magnitude 4. Sound decibels: every 10 dB increase is 10× more sound intensity. pH: each unit represents a 10× change in hydrogen ion concentration; pH 4 is 100× more acidic than pH 6. These scales allow us to compare quantities spanning many orders of magnitude on a single, human-readable scale.

What are the key logarithm rules I should know?

The four fundamental logarithm rules are: Product rule — log(a × b) = log(a) + log(b); Quotient rule — log(a/b) = log(a) − log(b); Power rule — log(a^n) = n × log(a); Change of base — log_b(x) = log_a(x) / log_a(b). These rules were historically important because they turned multiplication into addition (used in slide rules and log tables). Today, they're essential for solving exponential equations: if 2^x = 50, then x = log₂(50) = log(50)/log(2) ≈ 5.64.

What is log base 2 used for in computing?

Log base 2 (log₂) is fundamental in computer science and information theory. Binary counting uses base 2, so log₂(n) tells you how many bits are needed to represent n states: log₂(256) = 8 bits (1 byte), log₂(65,536) = 16 bits. Algorithm complexity often grows as O(log n) — binary search, balanced binary trees, and divide-and-conquer algorithms all have log₂ complexity. In information theory, log₂ measures information in bits: the probability p of an event carries −log₂(p) bits of information.