๐งฎ Logarithm Calculator: log base b of any number
By Shihab Mia ยท Updated 2026-07-03
This logarithm calculator finds log base b of any positive number in one step, for any base you choose. It answers the core question a logarithm asks: to what power must you raise the base to get your number? Preset buttons give you the common log (base 10), the natural log (ln, base e) and log2 (base 2) instantly, and an inverse mode turns a log result back into the original number using x = b to the power y.
What is the Logarithm Calculator?
A logarithm is the inverse of raising a base to a power. When you write log base b of x = y, you are saying that b raised to the power y equals x. So log base 10 of 1000 is 3, because 10 to the power 3 is 1000, and log base 2 of 8 is 3, because 2 cubed is 8. Reading a logarithm as a question ("what exponent turns the base into this number?") is the fastest way to build intuition, and it is exactly what this logarithm calculator computes for you.
Under the hood the calculator uses the change of base formula. Most programming languages and calculators only give you the natural log directly, so to find a log in any base b the tool computes ln(x) divided by ln(b). That single identity, log base b of x = ln(x) / ln(b), lets one logarithm calculator handle base 2, base 10, base e or any unusual base such as 7 or 1.5 with identical accuracy. The steps panel shows this division explicitly so you can follow the arithmetic rather than trusting a black box.
Three bases come up so often that they have their own names. The common log is base 10, written simply as log in most textbooks, and it powers the decibel and pH scales. The natural log is base e (about 2.71828), written ln, and it appears throughout calculus, growth and decay, and finance. The binary log is base 2, written log2, and it measures information in bits and the depth of divide and conquer algorithms. The preset buttons in this logarithm calculator switch between these three with one click, but you are never limited to them.
Logarithms are only defined for a positive number x, and the base b must be positive and not equal to 1. You cannot take the log of zero or a negative number because no real exponent turns a positive base into zero or a negative value, and a base of 1 fails because 1 raised to any power is always 1. This calculator validates those rules and shows a plain-language message instead of a confusing error, so you always know why a particular input has no answer.
The inverse mode reverses the whole process. If you already have a logarithm result y and want to recover the original number x, the calculator computes x = b to the power y, sometimes called the antilogarithm. This is useful when you are working backwards from a decibel reading, a pH value or a log-scaled chart axis and need the real underlying quantity. Together, the forward and inverse modes make this logarithm calculator a complete two-way tool for anything on a logarithmic scale.
When to use it
- Solving exponential equations like 2^x = 50 by rewriting x as a logarithm and reading it off directly.
- Homework and exams that need log base 2, base 10 or the natural log with the change of base steps shown.
- Converting between decibels, pH or the Richter scale, which are all logarithmic, and their raw linear values.
- Estimating how many doublings or halvings something takes, for example log2 of a data size in a computer science course.
- Checking finance and growth calculations that rely on the natural log, such as continuous compounding or half-life.
- Reading log-scaled chart axes and using the inverse mode to recover the original numbers behind each tick.
How to use the Logarithm Calculator
- Choose a base, or click a preset: 10 for the common log, e for the natural log (ln), or 2 for log2.
- In Logarithm mode, type the positive number x you want the logarithm of.
- Read the result, which is the exponent that turns your base into x, along with the change of base steps.
- Switch to Inverse mode to go the other way: enter a base and a log result y to get x = b to the power y.
- Use the Copy button to copy the result, and adjust any field to see the answer update instantly.
Formula & method
Worked examples
Find the common log: log base 10 of 1000.
- Base b = 10, number x = 1000.
- Ask: 10 to what power gives 1000?
- Using change of base: ln(1000) / ln(10) = 6.907755 / 2.302585.
- That division equals 3.
Result: log base 10 of 1000 = 3
Find log base 2 of 8 (a binary log used in computing).
- Base b = 2, number x = 8.
- Ask: 2 to what power gives 8?
- ln(8) / ln(2) = 2.079442 / 0.693147.
- The result is 3, and indeed 2 cubed is 8.
Result: log base 2 of 8 = 3
Use inverse mode: given base 10 and a log result of 2.5, recover x.
- Base b = 10, log result y = 2.5.
- The inverse of a logarithm is x = b to the power y.
- x = 10^2.5.
- 10^2.5 = about 316.227766.
Result: x = 10^2.5 = about 316.23
Common logarithm values you can check by hand
| Expression | Reads as | Value |
|---|---|---|
| log base 10 of 1 | 10^0 | 0 |
| log base 10 of 100 | 10^2 | 2 |
| log base 2 of 16 | 2^4 | 4 |
| log base 2 of 1024 | 2^10 | 10 |
| ln of e | e^1 | 1 |
| ln of 1 | e^0 | 0 |
The three named logarithm bases and where they appear
| Name | Base | Written | Typical use |
|---|---|---|---|
| Common log | 10 | log | Decibels, pH, Richter scale |
| Natural log | e (2.71828) | ln | Calculus, growth and decay, finance |
| Binary log | 2 | log2 | Bits of information, algorithm depth |
Common mistakes to avoid
- Taking the log of zero or a negative number. A logarithm is only defined for a positive number x. No real exponent turns a positive base into 0 or a negative value, so log of 0 and log of -5 are undefined. The calculator flags this instead of guessing.
- Using a base of 1 (or a negative base). 1 raised to any power is always 1, so log base 1 can never reach any other number and is undefined. The base must be greater than 0 and not equal to 1.
- Confusing log (base 10) with ln (base e). On many calculators "log" means base 10 while "ln" means base e. They give different numbers, so always confirm which base a formula expects before you type.
- Dividing when you should be taking a logarithm. To solve 2^x = 50 you do not divide 50 by 2. You take a logarithm: x = log base 2 of 50, which is about 5.64. Logarithms undo exponents, they are not ordinary division.
- Forgetting the change of base direction. The formula is ln(x) / ln(b), with the number on top and the base on the bottom. Flipping it to ln(b) / ln(x) gives the reciprocal and a wrong answer.
Glossary
- Logarithm
- The exponent that a base must be raised to in order to produce a given number. log base b of x = y means b to the power y equals x.
- Base (b)
- The number being raised to a power in a logarithm. It must be greater than 0 and not equal to 1.
- Argument (x)
- The positive number you are taking the logarithm of, sometimes called the antilogarithm result.
- Common log
- A logarithm with base 10, usually written simply as log. Used in decibels and pH.
- Natural log (ln)
- A logarithm with base e, roughly 2.71828. Central to calculus, growth and finance.
- Binary log (log2)
- A logarithm with base 2, measuring information in bits and the depth of many algorithms.
- Change of base
- The identity log base b of x = ln(x) / ln(b), which lets you compute a logarithm in any base from natural logs.
- Antilogarithm
- The inverse of a logarithm: given a base b and a result y, the antilog is x = b to the power y.
Frequently asked questions
What does this logarithm calculator do?
It finds log base b of any positive number for any valid base, and shows the change of base steps. Presets give the common log (base 10), the natural log (ln, base e) and log2. An inverse mode turns a log result back into the original number.
How do you calculate a logarithm by hand?
Ask what power the base must be raised to in order to reach your number. For a general base, use the change of base formula log base b of x = ln(x) / ln(b), dividing the natural log of the number by the natural log of the base.
What is the difference between log and ln?
On most calculators log means base 10 (the common log) and ln means base e, the natural log where e is about 2.71828. They answer the same kind of question but for different bases, so their values differ.
How do I find log base 2 of a number?
Click the base 2 preset and enter your number, or set the base field to 2. The calculator computes ln(x) / ln(2). For example log base 2 of 1024 is 10, because 2 to the power 10 is 1024.
Why is the logarithm of a negative number undefined?
A logarithm asks which exponent turns a positive base into your number. No real exponent turns a positive base into a negative value or zero, so logs of negative numbers and of zero have no real answer.
Can the base be any number?
The base can be any positive number except 1. A base of 1 always returns 1 no matter the exponent, and negative or zero bases break the definition, so the base must be greater than 0 and not equal to 1.
What is the inverse of a logarithm?
The inverse, or antilogarithm, is raising the base to the result: if log base b of x = y then x = b to the power y. Use this calculator inverse mode to recover x from a base and a log value.
How do I solve an exponential equation like 2^x = 50?
Take the logarithm of both sides. x = log base 2 of 50, which the change of base formula gives as ln(50) / ln(2), about 5.6439. Enter base 2 and 50 in this logarithm calculator to confirm it.
Is this natural log calculator free?
Yes. The tool runs entirely in your browser at no cost, with no sign-up and no limits, whether you need the natural log, the common log, log2 or a custom base.
What is e in the natural log?
e is Euler number, approximately 2.71828. It is the base of the natural logarithm and arises naturally in continuous growth, compound interest and calculus, which is why ln is called the natural log.