Logarithm base conversion:
formula and worked example
Any calculator with only ln or log10 can give you a log in base 2, 5 or 12 using one division.
Calcylator Editorial Team
Updated · 4 min read
What a logarithm in a chosen base answers
A logarithm asks the reverse of a power question. Instead of asking what 2 to the power of 6 is, it asks: what power of 2 gives 64? The answer, 6, is the logarithm of 64 in base 2.
The base matters because different fields count in different units. Computing counts how many times a quantity can be halved, so base 2 is natural: 64 values need 6 binary digits. Everyday digit counting uses base 10, where a number's digit count is one more than the whole part of its log. Growth and decay models in science tend to use base e, the natural log.
Most calculators only have ln and log10 keys, so a conversion rule is needed to reach any other base. That rule is the change-of-base formula.
The change-of-base rule and its inputs
Take the natural log of the number and divide by the natural log of the base. Any common log works equally well, as long as the same one is used on top and bottom.
- number:
- Number
- base:
- Base
- Number: the value whose logarithm you want. It must be greater than zero.
- Base: the base you want the log expressed in. It must be positive and not equal to 1.
- Result: the exponent to which the base must be raised to give the number.
Using log10 on both lines gives the same answer as ln on both lines, because the conversion factor cancels in the ratio.
Worked example: the base-2 log of 64
Find how many times 2 must be multiplied by itself to reach 64.
Number
64
Base
2
Logarithm base conversion
6 number
Since 64 = 2^6, the answer is exactly 6. The two natural logs are about 4.1589 and 0.6931, and their ratio is 6.
- Natural log of the number: ln 64 ≈ 4.1589.
- Natural log of the base: ln 2 ≈ 0.6931.
- Divide: 4.1589 ÷ 0.6931 ≈ 6.0000, which is exactly 6.
Verify by raising: 2^6 = 64. A conversion result that does not reproduce the number when raised is wrong.
What the converted value means
A whole-number answer, like 6, means the number is an exact power of the base. Most real inputs are not: the base-2 log of 100 is about 6.64, which says 100 lies between 2^6 = 64 and 2^7 = 128, closer to the 7th power.
In computing, the base-2 log, rounded up, gives the number of bits needed to represent that many distinct values: 100 values need 7 bits. In search, it approximates how many halving steps a binary search takes to narrow a sorted list down to one item.
In other settings, base 10 gives order of magnitude. A value with a log10 of 4.3 is roughly 20,000, comfortably between 10^4 and 10^5. When data span huge ranges, taking logs puts them on a scale where equal steps mean equal multiples.
What a percentage change in the number does to the log
Logs turn multiplication into addition. Multiplying the number by 1.1 adds log(1.1) to the result, a fixed amount that does not depend on the starting value. In base 2 that fixed amount is about 0.1375.
| Scenario | Number | Calculated result |
|---|---|---|
| Original assumptions | 64 | 6 number |
| Number increased by 10% | 70.4 | 6.138 number |
This is why a log scale treats a 10% rise from 64 and a 10% rise from 6,400 as the same step. Doubling the number always adds exactly 1 in base 2, which is the usual way to remember the scale.
Domain and arithmetic errors
- Using a base of 1. Every power of 1 is 1, so there is no log, and the formula divides by ln 1 = 0.
- Entering zero or a negative number. Real logarithms are only defined for positive numbers.
- Mixing log types: dividing log10 of the number by ln of the base, which gives a meaningless value.
- Rounding the intermediate logs too early, which can make an exact answer like 6 show up as 5.99 or 6.01.
Checking how many digits or bits a value needs
How many bits are needed to number 1,000 distinct items, and how does the formula get there?
- Compute ln(1000) ÷ ln(2) ≈ 6.9078 ÷ 0.6931 ≈ 9.97.
- Round up to the next whole number: 10.
- Confirm: 2^10 = 1,024, which is at least 1,000, while 2^9 = 512 is not.
Rounding down would leave some items without a code, so the ceiling is the right rounding in this use.
Common questions
What is the change of base formula?
The log of a number in any base equals the natural log of the number divided by the natural log of the base. Common logs work equally well, provided you use the same type for both. The result is the exponent.
How do I calculate log base 2 on a calculator?
Divide ln of the number by ln 2, or log10 of the number by log10 of 2. For 64 that gives 6. If your calculator has a log2 key, use it, but the division gives the same value.
Why can the base not be 1?
Because 1 raised to any power is 1, so no exponent can produce any number other than 1. In the formula the denominator ln 1 is zero, so the division is undefined.
Can you take the logarithm of a negative number?
Not with real numbers. A positive base raised to any real power is always positive, so there is no real exponent that gives a negative result. Complex numbers extend the idea, but that is beyond ordinary use.
What does the log of a number between two powers mean?
It is a fractional exponent. A base-2 log of 6.64 for 100 means 2 raised to 6.64 gives 100. It tells you the number sits between 2^6 and 2^7, placed proportionally on a multiplicative scale.
Was this guide helpful?
Continue reading
View all blogsCircle area from diameter: formula and worked example
Find a circle's area from its diameter: the halve-then-square rule, an 8-unit worked example, a growth table and the slips that cost people accuracy.
6 min read
Circle circumference from radius: formula and worked example
Work out the distance around a circle from its radius with 2 x pi x r, a 4.5-unit example, scaling behaviour and the mix-ups that make fencing run short.
6 min read
Annulus area: formula, example and practical interpretation
How to find the area of a ring between two concentric circles: pi x (R^2 - r^2), a worked 6 and 4 example, scaling and the classic subtraction slip.
6 min read




