How to use the logarithm calculator
- Type the number you are working with in the first box, labelled Number (a). Whole numbers, decimals, negatives and scientific notation such as 1e6 all work.
- Type the second value in the box labelled b. The tool uses it three ways at once: as the exponent, as the root index, and as the base of the logarithm.
- Press Calculate. The first row shows a to the power b. The rows below show the b-th root of a, the logarithm of a in base b, and the three most common logarithms: base 10, base 2 and the natural log.
- If a result is not a real number, the row explains why in plain words, for example that logarithms exist only for positive numbers.
- Press Copy result to put a one-line summary on your clipboard, or Clear to start over.
What a logarithm actually is
A logarithm answers the question: what exponent do I need? If 2 raised to the power 10 equals 1,024, then the logarithm of 1,024 in base 2 is 10. Written formally, logb(a) = x means bx = a. Logarithms turn multiplication into addition, which is why they were the foundation of slide rules and printed log tables for centuries, and why they remain essential in science, engineering, finance and computing today.
Three bases dominate everyday use. The common logarithm, log10, counts powers of ten: log10(1,000) = 3. The binary logarithm, log2, counts how many times you can halve something and is the natural unit in computer science: log2(1,024) = 10. The natural logarithm, written ln, uses Euler's number e (about 2.71828) as its base and appears wherever growth and decay are continuous, from compound interest to radioactive half-life.
Exponents and roots are the same family
Exponentiation, roots and logarithms are three views of one relationship. Given bx = a, an exponent finds a when you know b and x. A root finds b when you know a and x, because b is the x-th root of a. A logarithm finds x when you know a and b. That is why this calculator shows all three side by side: for a = 64 and b = 2 you see 642 = 4,096, the square root of 64 = 8, and log2(64) = 6.
A root with a fractional exponent is the same thing: raising a number to the power 0.5 is a square root, and to the power 1/3 is a cube root. Negative exponents give reciprocals, so 2 to the power -3 is 1/8, or 0.125.
Change of base
Most calculators only have log (base 10) and ln buttons. To get any other base, divide: logb(a) = ln(a) ÷ ln(b), or equally log10(a) ÷ log10(b). To find log5(200), compute ln(200) ÷ ln(5) = 5.2983 ÷ 1.6094, which is about 3.2920. This tool applies the change of base formula for you, so any positive base other than 1 works.
Where logarithms are used
- Decibels: sound level is 10 × log10 of a power ratio, so doubling the power adds about 3 dB.
- Earthquakes: the Richter and moment magnitude scales are logarithmic, so each whole step is roughly 32 times more energy.
- pH: acidity is minus log10 of the hydrogen ion concentration. A drop of one pH unit means ten times more hydrogen ions.
- Computer science: binary search takes about log2(n) steps, and the number of bits needed to store n values is the logarithm base 2 rounded up.
- Finance: the time for money to double at a fixed rate uses ln(2) ÷ ln(1 + rate), the idea behind the rule of 72.
- Algebra homework: solving equations such as 3x = 50 means taking a logarithm of both sides: x = log(50) ÷ log(3), about 3.5609.
When the answer is undefined
Logarithms are only defined for positive numbers, so log of 0 or of a negative number has no real answer, and the tool says so. The base must be positive and cannot equal 1, because 1 raised to any power is still 1. Even roots of negative numbers, such as the square root of -4, are not real numbers; odd roots such as the cube root of -8 are, and the tool returns -2. Raising a negative number to a fractional power is likewise undefined within the real numbers. Messages are shown next to the affected row so you can still read the other results.
Tips and common mistakes
- Remember that "log" means base 10 on most calculators and in many textbooks, but base e in some advanced math and programming languages. This tool labels each base explicitly so there is no ambiguity.
- The logarithm of 1 is always 0 whatever the base, and the logarithm of the base itself is always 1.
- Do not type thousands separators. Enter 1000000, not 1,000,000, or use 1e6.
- Floating point arithmetic can produce tiny noise such as 2.9999999999. The tool rounds to 12 significant digits so exact answers like 3 appear cleanly.
Private by design
The numbers you type are processed by your browser and never uploaded, stored or tracked. The page works offline once loaded, so you can use it in an exam-prep session or on a plane without any connection.
Frequently asked questions
What is the logarithm of a number?
It is the exponent you must raise the base to in order to get the number. Since 10 to the power 3 is 1,000, log base 10 of 1,000 is 3. Enter 1000 as a and 10 as b to see it.
What is the difference between log and ln?
Log usually means base 10 and ln means the natural logarithm with base e, about 2.71828. The tool shows log10, log2 and ln separately, plus the log in whatever base you type as b.
How do I calculate a logarithm with a different base?
Use the change of base formula: log base b of a equals ln(a) divided by ln(b). Type the number as a and the base as b, and the row "log base b of a" gives the answer.
Why does the calculator say a logarithm is undefined?
Logarithms exist only for positive numbers, and the base must be positive and not equal to 1. Zero and negative numbers have no real logarithm. Try a positive value of a.
How do I find a cube root or other root?
Type the number as a and the root index as b. For the cube root of 27, enter 27 and 3 and read the root row, which shows 3. Odd roots of negative numbers also work, so the cube root of -8 is -2.
What is Euler's number e?
It is the constant 2.718281828..., the base of the natural logarithm. It appears in continuous growth, compound interest and probability. The tool does not need you to type e, because the ln row already uses it.
Can I enter very large or very small numbers?
Yes, use scientific notation such as 1e12 or 2.5e-8. Results beyond about 1e15 or below 1e-9 are shown as "× 10^n". Extremely large powers that overflow are reported as too large.
Are my numbers sent to a server?
No. All calculations run locally in your browser, and nothing is uploaded, stored or tracked.
Related tools
Need custom software, a faster website or help with digital projects? The team at 4D1A can help.