# Understanding Logarithms and How to Calculate Them

*Published 2026-09-01.*

> Logarithms are just a different way of writing exponents. Learn how logarithms work, the change-of-base formula, the three most common bases, and the mathematical rules that govern them.

**Canonical:** https://onlinecalculator.me/blog/how-logarithm-is-calculated/
**Companion calculator:** https://onlinecalculator.me/math/logarithm/

A logarithm is just a different way of writing an exponent. Instead of telling you to multiply a number by itself, a logarithm works backward. It asks a specific question: "How many times do I need to multiply this base number by itself to reach my target?"

Usually, in math, you know the base and the exponent, and you want to find the result. With a logarithm, you know the base and the result, but you need to find the missing exponent. Once you see this relationship, higher-level math makes a lot more sense. You also stop guessing what your calculator is actually doing behind the scenes.

## The core intuition: thinking in exponents

To read a logarithm, you just need to know its basic structure. The standard mathematical notation is log_b(x) = y. In plain English, you read this as "the logarithm base b of x is equal to y."

What this really means is that b raised to the power of y equals x. 

Take the expression log₂(8) = 3. 
The base (b) is 2. 
The target value (x) is 8. 
The result (y) is 3.

This works because if you raise 2 to the power of 3 (which means 2 × 2 × 2), you get 8. The logarithm isolates the exponent. It answers the question, "What power do I raise 2 to so I can get 8?"

Base 10 is another common example. If you want to find log₁₀(1000), you are asking what power turns 10 into 1000. Since 10 × 10 × 10 equals 1000, the result is 3. 

## How is a logarithm calculated using a formula?

When the numbers are perfectly round, you can usually figure them out in your head. But what if you need to find the logarithm of 45 using base 3? You are looking for a highly specific exponent that turns 3 into 45. That is going to be a messy decimal. 

Mathematicians and computers handle this using a universal rule called the change-of-base formula.

The formula states that log_b(x) = ln(x) ÷ ln(b). 

Here, "ln" stands for the natural logarithm. This formula is incredibly useful because it lets you calculate a logarithm of any custom base using standard natural logarithms, which are baked into almost every computing device. (You can also use base 10 logarithms for this trick: log₁₀(x) ÷ log₁₀(b) will give you the exact same answer).

If you want to find log₃(45), you just divide the natural log of 45 by the natural log of 3. Let us walk through the math. 
The natural log of 45 is approximately 3.80666. 
The natural log of 3 is roughly 1.09861. 
Divide 3.80666 by 1.09861, and you get approximately 3.465.

This tells us that 3 raised to the power of 3.465 equals 45. This exact division is what happens inside a scientific calculator when you enter a custom base.

## The three most common bases

Technically, you can use almost any positive number as a base. In practice, three specific bases dominate mathematics, science, and engineering. 

**Base 10 (Common Logarithm)**
Usually written as log₁₀(x) or sometimes just log(x), this is historically the most widely used logarithm because our counting system is based on 10. Base 10 logarithms scale massive numbers down to manageable sizes. They form the mathematical foundation for measuring earthquakes on the Richter scale, sound intensity in decibels, and acidity using pH levels. Because it is a logarithmic scale, an earthquake measuring 6.0 is ten times stronger than one measuring 5.0. 

**Base e (Natural Logarithm)**
Written as ln(x), the natural logarithm uses Euler's number (e) as its base. Euler's number is a mathematical constant approximately equal to 2.71828. Natural logarithms are essential in calculus, physics, and finance. They describe systems that grow continuously. If you are calculating compound interest with a compound interest calculator, modeling population growth, or tracking radioactive decay, you are dealing with base e. 

**Base 2 (Binary Logarithm)**
Written as log₂(x), this base is the fundamental building block of computer science. Modern computers operate on binary logic, meaning everything breaks down to zeros and ones. Base 2 logarithms are heavily used to figure out data storage limits, algorithm efficiency, and network bandwidth. For example, log₂(8) = 3 tells a software engineer that it takes exactly 3 binary bits to represent 8 distinct values.

## Rules and limitations

Logarithms have strict mathematical boundaries. These rules tie directly back to how exponents work. If you try to run a calculation outside of these boundaries, the result will not be a real number.

First, the target value (x) must always be a positive number greater than zero. You cannot calculate the logarithm of zero or a negative number. There is no real exponent you can apply to a positive base to get a negative result or zero. 

Second, the base (b) must be a positive number, and it cannot be exactly 1. If the base is 1, raising it to any power will always equal 1, since 1 × 1 × 1 is always 1. That makes it impossible to reach any other target number, rendering the calculation useless.

Third, taking the logarithm of values strictly between 0 and 1 will always result in a negative number. For instance, log₁₀(0.1) equals −1. This happens because a negative exponent flips the number into a fraction. Raising 10 to the power of −1 is the same as 1 ÷ 10, which equals 0.1.

Finally, two universal rules apply to every valid logarithm base:
The logarithm of 1 is always 0. Any number raised to the power of 0 equals 1. Therefore, log_b(1) = 0.
The logarithm of the base itself is always 1. Any number raised to the power of 1 is just itself. Therefore, log_b(b) = 1.

## Examples of exponents and logarithms

To solidify how these concepts mirror one another, this table shows how standard calculations translate directly between exponent format and logarithm format.

| Exponent format | Logarithm format | Base used |
|---|---|---|
| 2³ = 8 | log₂(8) = 3 | 2 |
| 10³ = 1000 | log₁₀(1000) = 3 | 10 |
| e¹ = e | ln(e) = 1 | e |
| 3³ = 27 | log₃(27) = 3 | 3 |
| 5² = 25 | log₅(25) = 2 | 5 |

Understanding this relationship removes the complexity from logarithmic math. By relying on the change-of-base formula, you can find the exact exponent needed for any scenario.

To compute common or custom bases instantly, use our [Logarithm Calculator](/math/logarithm/).

## Frequently asked questions

### What is a logarithm?

A logarithm is a mathematical operation that works backward from an exponent. It helps you find the missing power needed to multiply a base number by itself to reach a specific target value. For example, it answers what power turns the base into the result.

### What are the most common logarithm bases?

The three most common bases used in math and science are base 10, base e, and base 2. Base 10 is widely used for measuring things like earthquakes and sound intensity. Base e is essential for calculus and continuous growth, while base 2 is the foundation of computer science.

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

No, you cannot calculate the logarithm of a negative number or zero. The target value must always be a positive number greater than zero. This is because there is no real exponent you can apply to a positive base to get a negative result.


---

Part of [onlinecalculator.me](https://onlinecalculator.me/) — free calculators that run entirely in your browser.
