Logarithm Any Base Calculator
A logarithm reverses the act of raising a number to a power. If you know that some base multiplied by itself a number of times produces a target value, the logarithm tells you exactly how many times. This calculator handles any base you choose, not just the familiar natural and common logarithms, by applying the change-of-base formula. That formula expresses log to base b of x as the ratio of two natural logarithms, ln(x) divided by ln(b), which is how every scientific calculator computes arbitrary bases internally. You enter the value and the base, and the tool returns the exponent, computed deterministically rather than estimated, so the worked example reconciles exactly with the figure on screen. Logarithms appear everywhere quantities span many orders of magnitude: the decibel scale for sound, the pH scale for acidity, the Richter scale for earthquakes, and the running time of efficient algorithms all rest on them. Base 2 is the language of information and computing, base 10 suits everyday orders of magnitude, and base e arises naturally in continuous growth and decay. Use this tool to evaluate a logarithm by hand, to check homework, or to convert quickly between any two bases.
The logarithm of x to base b uses the change-of-base formula log_b(x) = ln(x) / ln(b). For a value of 256 and a base of 2, the result is 8.00, because 2 raised to the power 8 equals 256.
Change-of-base formula
log_b(x) = ln(x) / ln(b)
x = the value (must be greater than 0)
b = the base (greater than 0 and not equal to 1)
ln = natural logarithm (base e)
Any logarithm base can be evaluated by dividing the natural logarithm of the value by the natural logarithm of the base. The same identity holds with common (base 10) logarithms in place of natural ones, because the shared base cancels in the ratio.
Worked example
Compute log to base 2 of 256.
- ln(256) = 5.545177
- ln(2) = 0.693147
- log_2(256) = 5.545177 / 0.693147 = 8.00
The answer is 8, which checks out because 2 raised to the power 8 equals 256. These are the calculator's default inputs, so the result above matches the widget exactly.
Common logarithm values
| Value (x) | log_2 | log_10 | ln |
|---|---|---|---|
| 2 | 1.0000 | 0.3010 | 0.6931 |
| 10 | 3.3219 | 1.0000 | 2.3026 |
| 100 | 6.6439 | 2.0000 | 4.6052 |
| 256 | 8.0000 | 2.4082 | 5.5452 |
Reference: US National Institute of Standards and Technology (NIST).
Logarithm calculator: frequently asked questions
What is a logarithm in any base?
The logarithm of x to base b, written log_b(x), is the exponent you must raise b to in order to get x. For example log_2(8) equals 3 because 2 raised to the power 3 equals 8. A logarithm answers the question how many times do I multiply the base by itself to reach this number.
What is the change-of-base formula?
The change-of-base formula lets you compute a logarithm in any base using natural or common logarithms: log_b(x) equals ln(x) divided by ln(b), or equivalently log10(x) divided by log10(b). It works because dividing two logarithms in the same base cancels that shared base, leaving the ratio you want.
Why does the base have to be positive and not one?
The base of a logarithm must be greater than zero and not equal to one. A base of one would mean every power equals one, so no exponent could produce a different value, and negative bases produce undefined or complex results. The value x being taken must also be positive, because no real exponent of a positive base gives a zero or negative result.
What is the difference between ln, log and log_b?
ln is the natural logarithm with base e (about 2.71828), log without a subscript usually means base 10 (the common logarithm), and log_b is the general logarithm to whatever base b you choose. All three are connected by the change-of-base formula, so any one can compute the others.
When are non-standard bases useful?
Base 2 logarithms count how many times a quantity can be halved, which is central to computing and information theory. Base 10 suits orders of magnitude such as decibels and pH. A custom base can describe growth or decay processes whose natural multiplier is neither 2, 10 nor e.
Official sources
- Mathematical functions and constants reference: US National Institute of Standards and Technology (NIST). As at 25 June 2026.
Reviewed by the CalculatorHub team, edited by James Graham, 25 June 2026. See our methodology. This is general information, not financial, tax, legal or investment advice.