Logarithm Calculator
Find the logarithm of any number in base 10, e, 2, or a custom base. Solve for the number, the logarithm, or the base, with change of base, the logarithm laws, and the characteristic and mantissa breakdown.
https://hexacalculator.com/calculators/mathematics/arithmetic/logarithm-calculator
Mathematics
Arithmetic
Logarithm Calculator
Find the logarithm of any number in base 10, e, 2, or a custom base. Solve for the number, the logarithm, or the base, with change of base, the logarithm laws, and the characteristic and mantissa breakdown.
Logarithm Calculator
Your logarithm
Pick a base, then enter a number to get its logarithm, or enter a logarithm to recover the number. With a custom base, fill any two of base, number, and logarithm and the third is solved.
Was this calculator helpful?
It takes one click and shapes what we fix next.
Explore further
Show the logarithm curve y = log of x
Plot how the logarithm rises as the number grows.
Compare the logarithm across bases
See the same number's logarithm in base 10, e, and 2.
Explore the logarithm laws
Demonstrate the product, quotient, and power rules on your own numbers.
The logarithm answers the question of what power a base must be raised to in order to get a certain number. For example, if we take 8; then with base 2, the answer is 3 because 2 to the power of 3 equals 8. This concept also applies for bases like 10 or e, or any positive number other than 1.
This calculator supports any base and can calculate in both directions. If you enter a value, it will give the corresponding logarithm, and if you enter a logarithm, it will find the original value. By selecting a custom base, you can also reverse-engineer the base itself.
What is a logarithm?
The notation "the logarithm of x to the base b is equal to y" is a shorthand for "b raised to the power of y is equal to x". So the logarithm of 1000 with base 10 is 3, because 10 raised to the third power is 1000. The logarithm of 32 with base 2 is 5, because 2 raised to the fifth power is 32.
The logarithm with base 10 is called the common logarithm and is usually written simply as "log". The logarithm with base e is called the natural logarithm; e is approximately 2.71828 and is written as "ln". The logarithm with base 2 is called the binary logarithm and is often used in computer science.
Here's how to use this calculator.
First select the base. Base 10 is suitable for most everyday calculations, while natural (e) corresponds to the ln button on scientific calculators and binary (2) is used in many areas of computer science. If you choose a custom base, then any positive value except 1 can be set as the base.
Next enter a value and leave the logarithm blank to calculate the logarithm. Alternatively, you can enter the logarithm and leave the value blank to perform the calculation in reverse direction. If using a custom base, you can also leave the base blank and enter both the value and the logarithm. The calculator will then find an appropriate base. In either case, the empty field is calculated.
Formula for base conversion
Inside the calculator you don't have to write a separate program for each base; instead, there is a formula for converting bases that allows any logarithm to be converted into one using a known base.
For this reason, you can choose any positive number as your base. The meaning of each symbol is explained below, along with some example values.
Symbol | Meaning | Example |
|---|---|---|
b | Base | 10 |
x | Number (the argument) | 1000 |
y | Logarithm (the result) | 3 |
Logarithmic laws.
There are three rules that allow you to turn multiplication into addition. This is the whole reason logarithms were invented. These rules work for any base.
The product law states that the logarithm of a product is equal to the sum of the respective logarithms. The quotient law turns division into subtraction. The power law moves the exponent in front and makes it a multiplier. If you turn on the "Logarithm laws" switch, you can check the full derivation of these three rules with your own numbers.
mantissa and characteristic
Before the invention of the calculator, people used to look up logarithms in printed tables. The way a logarithm is broken down still shows what the answer will be like today. Every logarithm has two parts: the characteristic, which is the whole number part, and the mantissa, which is the decimal part.
When the base is 10, the characteristic determines the number of digits and the mantissa determines the first digit. The logarithm of 245 is about 2.389, so the characteristic is 2. This means that 245 is between 100 and 1000, and the mantissa 0.389 determines the exact number. No matter what calculations you do, this decomposition will be shown in the results area.
Applications of logarithms.
The scope of logarithms is much broader than what you learn at school and they almost always appear when a quantity spans several orders of magnitude.
In chemistry, the pH is the negative logarithm of the hydrogen ion concentration to base 10. So a solution with a pH of 4 is ten times more acidic than one with a pH of 5, not just slightly more acidic.
In terms of sound, decibels are a logarithmic unit, so going from 60 decibels to 90 decibels sounds much louder than going from 60 decibels to 70 decibels, even though both changes are over a range of 30 units.
The Richter scale is a logarithmic scale so an earthquake of magnitude 7 releases about 32 times more energy than one of magnitude 6.
In finance, logarithms can be used to solve problems involving doubling time. At a compound interest rate of 7 percent, the time it takes for an investment to double in value is log(2) / log(1.07), which is approximately 10.2 years.
In computer science, the running time of a binary search is proportional to the logarithm (base 2) of the size of the input array because each step halves the number of elements being searched.
In statistics, a log transformation can be used to make data more normally distributed which improves the performance of charts and regression analysis.
Example for base 10.
Here are some general rules for logarithms explained using numbers. The log of a number greater than one is positive while the log of a number less than one is negative. However, the log of one is always zero.
Number x | log base 10 of x | Why |
|---|---|---|
1000 | 3 | 10 cubed is 1000 |
100 | 2 | 10 squared is 100 |
10 | 1 | 10 to the first is 10 |
1 | 0 | 10 to the zero is 1 |
0.1 | -1 | 10 to the minus 1 is 0.1 |
50 | 1.699 | between 10 and 100 |
Important notes:
Logs are only defined for positive numbers. The log of 0 approaches negative infinity and the log of a negative number is not a real number but does exist in the complex plane. Also, the base must be a positive number and cannot be equal to 1 since any power of 1 would still be 1 which would lead to an ambiguous solution. If the base is valid then the log of 1 will always be 0 since any number raised to the 0th power is 1.
Frequently asked questions
What is the difference between log and ln?
In engineering and most calculators "log" without a subscript means base 10, while "ln" is base e (e being approximately 2.71828). However in some pure mathematics works "log" may mean the natural logarithm so always be aware of the context. When using this calculator you do not have to guess; just explicitly state which base you want.
What is the inverse of a logarithm?
The inverse function is exponentiation, usually called the "antilogarithm". If a logarithm with base b of x equals y, then b raised to the power of y gives back x. This is why entering a logarithm and typing a number into a field will restore the original value.
Can you take the logarithm of a negative number?
No, not in the real number domain. This function will only return a real value if the input is a positive number. Complex logarithms can handle negative numbers but are part of another number system and are not used by this tool.
Why can't the base be 1?
Any power of 1 is always equal to 1. So if the yth power of an equation 1 equals x, there can be no value for x except 1. For this reason, y cannot be uniquely determined and the logarithm is not defined when the base is 1.
What is the logarithm of 1?
Regardless of the base, the result is 0. Since any positive number to the power of 0 is equal to 1, the logarithm of 1 will always be 0.
Related calculators






Disclaimer: This calculator is provided for general informational and educational purposes only. Our calculators are under active development, and results may be inaccurate, incomplete, or unsuitable for your situation. Always verify the figures independently and seek advice from a qualified professional before relying on them. We make no warranties and accept no liability for any loss or decision arising from use of this tool.
References
- Khan Academy: Intro to logarithms
Definition, the log-exponential relationship, and the logarithm laws.
- Math is Fun: Introduction to Logarithms
Plain-language explanation of logarithms, bases, and change of base.