🏆 US-Registered Digital Marketing Agency Trusted by 200+ brands · USA · UK · Canada · AUS
Advertisement
Advertisement
MATHS

Logarithm Calculator — any base, ln, log₁₀ and log₂

Find the logarithm of any number in any base, with the change-of-base working shown.

Must be greater than zero. The logarithm of zero or a negative number is not real.
Common bases: 10 for orders of magnitude, e ≈ 2.71828 for natural logs, 2 for computing.
Choosing a quick base fills the base field for you, including the constant e.
logb(x)
0
 
0
Natural log (ln x)
0
Common log (log₁₀ x)
0
Binary log (log₂ x)
0
Check: b raised to result
Working:  
Tip: a logarithm answers "what power do I raise the base to in order to get x?" — so log₁₀(1000) = 3 because 10³ = 1000.
Advertisement

The logarithm calculator above evaluates logb(x) for any positive number in any valid base, and shows the change-of-base arithmetic that produced the answer. It gives you the natural log, the common log and the binary log of the same number at once, and it verifies its own result by raising the base back to the answer.

Arb Digital maintains this alongside a full set of free maths tools. Logarithms are the operation behind decibels, pH, the Richter scale, information entropy, algorithm complexity and every log-scale chart in existence, so being able to read one correctly is more useful than most people expect from a school topic.

What This Logarithm Calculator Does

Enter a number and a base. The tool returns the logarithm — the exponent that the base must be raised to in order to produce your number. Because the three standard bases come up constantly, it also shows all three at the same time: the natural logarithm to base e, the common logarithm to base 10, and the binary logarithm to base 2. The fourth supporting figure is a verification: it takes your base, raises it to the answer, and shows you the number it gets back. If that value matches your input, the result is sound.

The base field accepts any positive value other than 1, and the quick-base selector fills in the constant e to full precision so you do not have to type an approximation. The working line spells out the change-of-base division with your own numbers, which is exactly the step most students lose marks on.

How to Use It

  1. Enter the number. It must be greater than zero. The calculator explains what happens at zero and below rather than showing an error.
  2. Choose a base. Use the quick selector for 10, e or 2, or type any other positive base such as 5 or 1.05.
  3. Set the decimal places. Six is plenty for most work; increase it if you are chaining the result into another calculation.
  4. Read the verification figure. The fourth result raises your base to the answer. It should return your original number, give or take rounding.
  5. Check the working line to see the change-of-base formula applied to your specific values.

The Formula / How It's Calculated

A logarithm is the inverse of a power. The statement logb(x) = y means exactly the same thing as by = x. Reading the two forms as interchangeable is the whole skill. log10(1000) = 3 because 103 = 1000. log2(32) = 5 because 25 = 32. log5(1) = 0 because any base to the power zero is 1.

Computers only implement one or two logarithms natively, so every other base is reached through the change-of-base formula: logb(x) = ln(x) ÷ ln(b). For the loaded example, ln(1000) ≈ 6.907755 and ln(10) ≈ 2.302585, and 6.907755 ÷ 2.302585 = 3 exactly. You can use log base 10 in place of ln on both the top and bottom and get the same answer; what matters is that the same base is used for both. The MathWorld entry on logarithms sets out the identity in full, and the NIST Digital Library of Mathematical Functions section 4.2 gives the formal definition of the natural logarithm the whole system rests on.

Advertisement

Why log of Zero and Negative Numbers Is Undefined

Ask what power of 10 gives zero. There isn't one. 101 = 10, 100 = 1, 10−1 = 0.1, 10−10 = 0.0000000001. The results get closer and closer to zero but never arrive, no matter how negative the exponent gets. So log(0) has no value — mathematically the function tends towards negative infinity as x approaches zero from above, which is why log-scale charts can never include a zero.

Negative numbers are worse. A positive base raised to any real power is always positive, so no real exponent can ever produce a negative result. log(−5) has no real answer at all. Complex analysis does define logarithms of negative numbers using imaginary components, but that lives outside the real-number arithmetic this calculator performs, and any tool that quietly returns a number for log(−5) is not doing real arithmetic.

There is one more restriction people forget: the base itself must be positive and must not equal 1. Base 1 fails because 1 raised to any power is always 1, so it can never reach any other number, and the change-of-base division would be dividing by ln(1) = 0.

The Log Rules That Make Hard Arithmetic Easy

Logarithms turn multiplication into addition, which is precisely why they were invented and why slide rules worked. Three identities carry almost all the weight:

  • log(xy) = log(x) + log(y) — the log of a product is the sum of the logs.
  • log(x ÷ y) = log(x) − log(y) — the log of a quotient is the difference.
  • log(xn) = n × log(x) — a power comes down and becomes a multiplier.

The third rule is the one that solves real problems. If you need to know how many years at 7% growth are required to double a value, you are solving 1.07t = 2. Take logs of both sides: t × log(1.07) = log(2), so t = log(2) ÷ log(1.07) ≈ 10.24 years. No trial and error, no guessing. Any equation with the unknown stuck in the exponent is a logarithm problem, and that structure is the same whether you are doing compound growth, radioactive decay, or cooling curves.

Reading a Log Scale Correctly

On a logarithmic axis, equal distances represent equal ratios rather than equal amounts. The gap from 1 to 10 is the same width as the gap from 10 to 100 and from 100 to 1,000. That property makes a log scale ideal for data spanning several orders of magnitude, because a single chart can show both small and enormous values without the small ones collapsing into the axis.

It also makes log charts easy to misread. A line that looks like gentle, slowing growth on a log axis may be perfectly steady exponential growth — a straight line on a log scale is constant percentage growth. And a modest-looking vertical rise can represent a tenfold jump. Whenever you see a chart where the axis labels go 1, 10, 100, 1,000, mentally re-read the shape before drawing a conclusion from it. Our scientific notation converter is a quick way to see the order of magnitude of any figure you are plotting.

Where Each Base Is Actually Used

Base 10 is the language of orders of magnitude. The pH scale, the decibel, and the Richter magnitude scale are all base-10 logarithmic, which is why one pH step means a tenfold change in hydrogen-ion concentration and a 2-point earthquake difference means roughly a hundredfold difference in amplitude.

Base e, the natural logarithm, appears wherever something changes at a rate proportional to its current size — continuous compounding, population models, cooling, radioactive decay. It is "natural" because the derivative of ln(x) is simply 1/x, which makes it the base that simplifies calculus rather than arithmetic.

Base 2 belongs to computing and information theory. log2 of a number tells you how many binary doublings, or bits, it represents: log2(1024) = 10, which is why a kilobyte is 1,024 bytes and not 1,000. Algorithm complexity classes such as O(log n) and O(n log n) are almost always base 2 for the same reason — each step halves the problem. The exponent calculator handles the reverse direction if you would rather work forward from a power.

Antilogs and Undoing a Logarithm

The antilogarithm is just the base raised back to the power: if logb(x) = y, then x = by. This calculator performs that step for you as the fourth grid figure, which doubles as an accuracy check. If the returned number differs slightly from your input in the last decimal places, that is floating-point rounding, not a mistake in the maths.

The practical use of antilogs is converting an averaged or interpolated log value back into a real quantity. Averaging log values and then converting back gives the geometric mean of the original numbers, not the arithmetic mean — which is the correct average for growth rates and ratios, and a subtly different number from the one a simple average would produce. That distinction matters any time you are averaging percentages or multipliers, and it is worth checking against the percentage change calculator before publishing a growth figure.

Need a different calculation?

Arb Digital publishes hundreds of free calculators and converters. They are all free to use, need no sign-up, and run entirely in your browser.

Browse All Free Tools Request a Tool

Common Mistakes to Avoid

  • Assuming "log" always means base 10 — in most software and in higher mathematics, a plain "log" means the natural logarithm to base e.
  • Splitting log(x + y) into log(x) + log(y) — the sum rule applies to products, never to sums. There is no simplification for the log of a sum.
  • Using different bases on the top and bottom of a change-of-base division — both logs must share the same base for the result to be valid.
  • Trying to take the log of zero or a negative number — neither has a real value, and no amount of rearranging changes that.
  • Averaging log values and treating the result as an ordinary average — converting back gives the geometric mean, not the arithmetic one.

Related Free Tools From Arb Digital

Logarithms undo powers, so the exponent calculator is the natural companion. For the special cases of index one half and one third, use the square root calculator and the cube root calculator. Large and small magnitudes read more clearly through the scientific notation converter, mixed expressions are fastest in the scientific calculator, and growth rates are covered by the percentage change calculator. Everything else is in the free online tools hub.

Frequently Asked Questions

What is a logarithm in simple terms?

It is the answer to the question "what power do I raise this base to in order to get this number?" Because 10 cubed is 1000, the log of 1000 to base 10 is 3. It is the exact inverse of raising to a power.

Why is the logarithm of zero undefined?

No real exponent applied to a positive base produces zero. As the exponent becomes more negative the result approaches zero without ever reaching it, so the function tends to negative infinity rather than taking a value at zero.

Can you take the logarithm of a negative number?

Not within real numbers. A positive base raised to any real power is always positive, so no real exponent can produce a negative result. Complex analysis defines a version using imaginary components, but it is outside real arithmetic.

What is the change-of-base formula?

The log of x to base b equals the natural log of x divided by the natural log of b. You can use base-10 logs instead as long as you use the same base on the top and the bottom of the division.

What is the difference between log and ln?

ln always means the natural logarithm to base e, approximately 2.71828. Plain log means base 10 in most school and engineering contexts, but base e in most programming languages and higher mathematics, so check which convention applies.

Why can the base not be 1?

Because 1 raised to any power is always 1, so a base of 1 can never produce any other number. The change-of-base formula also fails, since it would require dividing by the natural log of 1, which is zero.

How do logarithms solve for an unknown exponent?

Take the log of both sides and the exponent comes down as a multiplier. To solve 1.07 to the power t equals 2, divide log 2 by log 1.07, giving roughly 10.24. This is how doubling times and decay times are found.

This tool is provided for general educational use. Results are computed in double-precision floating point, so the final decimal places may differ slightly from an exact symbolic answer.

Advertisement
Advertisement
Arb Digital assistant

👋 Hey! Want to grow your business? Ask me anything — a free marketing proposal is on the table!