# Logarithm Calculator

Calculate logarithms for any custom base, common log base 10, and natural log ln with clear step-by-step rules and instant results.

---

- **Canonical URL:** https://dothecalculation.com/calculators/log-calculator
- **Category:** Math calculators
- **Publisher:** Do The Calculation (https://dothecalculation.com)
- **Cost:** Free, no account or sign-up required
- **Privacy:** Runs entirely in the browser; inputs are never sent to a server
- **Methodology:** https://dothecalculation.com/methodology
- **Reviewed by:** Dr. Elena Rostova, PhD, PhD in Pure Mathematics, Sorbonne University (https://dothecalculation.com/about/team/elena-rostova)

---

## Logarithm & Base Calculator

Evaluate logarithms for custom bases, common base 10, and natural log base e, displaying step-by-step change-of-base rules.

- Computes logs for any custom base b
- Natural log (ln) and common log (log10) presets
- Change-of-base formula worked proofs

## The Definition and Mathematical Meaning of Logarithms

A logarithm is the mathematical inverse of exponentiation. It answers the question: "To what power must a base \(b\) be raised to yield a target number \(x\)?" If the relationship is written as \(b^y = x\), then the logarithm of \(x\) with base \(b\) is equal to \(y\).

Written algebraically:

\[\log_b(x) = y \iff b^y = x\]

Logarithms are used to solve equations where the unknown variable is located in the exponent. They are essential in algebra, chemistry (pH scales), geology (Richter scale), acoustics (decibels), computer science (algorithmic complexity), and biology.

## The Change-of-Base Formula and Constants

Most numerical calculators only feature built-in functions for the natural logarithm (base \(e\)) and common logarithm (base 10). To compute a logarithm with a custom base \(b\), we apply the change-of-base formula:

\[\log_b(x) = \frac{\ln(x)}{\ln(b)} = \frac{\log_{10}(x)}{\log_{10}(b)}\]

This formula is derived by rewriting the exponential equation in logarithmic form and taking the log of both sides. It allows us to calculate any valid logarithm using natural logarithms.

Three logarithmic bases are particularly common:

**Natural Logarithm (ln)**: Uses Euler's number \(e \approx 2.7182818\) as its base. It is the default log in calculus due to its derivative properties.

**Common Logarithm (log)**: Uses base 10. It aligns with the decimal number system, making order-of-magnitude estimates straightforward.

**Binary Logarithm (log2)**: Uses base 2. It is central to computer science and information theory, representing binary doubling steps.

## How to Use This Calculator

Enter the value \(x\) you want the logarithm of, then choose a base: natural (e), common (10), binary (2), or a custom base. The calculator applies the change-of-base formula and returns the result.

## Worked Example: log₁₀(100), ln(100), and log₂(100)

For \(x = 100\) with a custom base of 10 (the default on this page):

$$\log_{10}(100) = \frac{\ln(100)}{\ln(10)} = \frac{4.605170}{2.302585} = 2$$

This checks out directly since \(10^2 = 100\). For comparison, using the natural log base gives \(\ln(100) \approx 4.605170\), and using base 2 gives \(\log_2(100) \approx 6.643856\) since \(2^{6.643856} \approx 100\).

## Related Calculators

To work with the inverse operation, use the [exponent calculator](/calculators/exponent-calculator). For scientific notation and other base-10 order-of-magnitude conversions, see the [scientific calculator](/calculators/scientific-calculator).

## Logarithmic Scales versus Linear Scales

A linear scale increases by adding a constant amount (e.g., 1, 2, 3, 4). A logarithmic scale increases by multiplying by a constant factor (e.g., 10, 100, 1000, 10000).

Logarithmic scales are used when dealing with data that spans several orders of magnitude. For example, the Richter scale measures earthquakes: a magnitude 6 earthquake is not 10% stronger than a magnitude 5; it is 10 times more powerful. Similarly, the decibel scale for sound and the pH scale for acidity are logarithmic, matching the way human senses perceive sound and chemical activity.

## Frequently asked questions

### What is a logarithm?

A logarithm is the power to which a base must be raised to yield a given number.

### What is the natural logarithm?

The natural logarithm, written ln(x), is the logarithm to the base e (Euler's constant, approximately 2.71828).

### What is the common logarithm?

The common logarithm, written log(x), is the logarithm to the base 10.

### What is the change-of-base formula?

It is log_b(a) = ln(a) / ln(b). It is used to calculate logarithms for custom bases.

### Can you take the logarithm of a negative number?

In real-number mathematics, the logarithm of a negative number or zero is undefined. This is because a positive base raised to any real power is always positive.

### Why is log(1) always equal to 0?

Because any base raised to the power of 0 equals 1: b^0 = 1.

### Why is log_b(b) equal to 1?

Because raising a base b to the power of 1 yields b: b^1 = b.

### What is the inverse of a logarithm?

Exponentiation is the inverse of logarithms. If y = log_b(x), the inverse is x = b^y.

### How do you solve an equation with a variable in the exponent?

Take the logarithm of both sides of the equation to bring the exponent down, then solve using standard algebra.

### What is a logarithmic scale?

A scale where each step is a multiple of the previous step (multiplicative growth) rather than a constant addition.

### What is the derivative of ln(x)?

In calculus, the derivative of the natural logarithm ln(x) with respect to x is 1/x.

### Why can't the base of a logarithm be 1?

Because 1 raised to any power is still 1. An equation like 1^y = 5 has no solution, and 1^y = 1 has infinite solutions, making base 1 mathematically useless for logarithms.

### Why does computer science use base-2 logarithms so often?

Because data is binary. log2(n) tells you how many yes/no bits are needed to represent n distinct values, and it's the operation count for algorithms that repeatedly halve a problem, like binary search on a sorted list.

## Related concepts

- **Change-of-Base Formula** — The identity that converts any logarithm into a ratio of logs in another base.
- **Exponential Function** — The inverse partner of the logarithm function.
- **Euler's Number e** — A fundamental constant used in natural logs and continuous compounding equations.

## Related guides

- [Scientific Notation Guide: Powers of Ten Made Practical](https://dothecalculation.com/blog/math/scientific-notation-basics) — Learn how to convert, compare, and calculate with powers of ten using worked examples and the live DTC scientific calculator.

## Related calculators

- [Derivative & Limit Solver](https://dothecalculation.com/calculators/derivative-solver) — Compute first and second derivatives of algebraic functions, find limits, and solve tangent line equations with clear steps.
- [Laplace & Inverse Laplace Transform Solver](https://dothecalculation.com/calculators/laplace-transform-calculator) — Compute Laplace transforms for time-domain functions and inverse Laplace transforms with clear step-by-step solutions shown.
- [Scientific Calculator](https://dothecalculation.com/calculators/scientific-calculator) — Calculate advanced arithmetic, trigonometry, logarithms, and exponential functions instantly with this free scientific calculator.
- [Taylor & Maclaurin Series Calculator](https://dothecalculation.com/calculators/taylor-series-calculator) — Compute Taylor and Maclaurin polynomial series approximations with clear step-by-step error analysis and instant results.
- [Bisection & Newton-Raphson Root Finder](https://dothecalculation.com/calculators/bisection-method-calculator) — Find roots of nonlinear equations using interval bisection and Newton-Raphson iterative methods with this free numerical solver.
- [Boolean Algebra Simplifier & K-Map Solver](https://dothecalculation.com/calculators/boolean-algebra-calculator) — Simplify Boolean logic expressions, generate truth tables, and visualize Karnaugh Maps instantly with this free algebra solver.

---

_This calculator is designed for academic, scientific, and planning purposes. Numerical limits, rounding parameters, or input precision rules should be verified manually before deploying calculations in engineering layouts or peer-reviewed papers._

---

_Source: [Do The Calculation](https://dothecalculation.com/calculators/log-calculator). Quote freely with attribution and a link to this page._
