Log Calculator

Calculate logarithms in base 10, e, 2 or any base, plus antilogs, solving for x or the base, and step-by-step change of base.

How it works

Enter a positive number x and choose a base. The logarithm answers: “what power of the base gives x?”

Any base works through the change-of-base rule: divide the natural log of x by the natural log of the base. We show each step.

Results are cleaned to 12 significant digits, so tiny floating-point errors don't show, log₁₀(1000) displays as exactly 3.

Formula

log_b(x) = ln(x) ÷ ln(b) antilog: x = b^y

Where:

x
= The number (must be > 0)
b
= The base (must be > 0 and ≠ 1)

Worked example

What is log base 5 of 125?

ln(125) = 4.8283… and ln(5) = 1.6094…; 4.8283 ÷ 1.6094 = 3. Check: 5³ = 125.

Mastering Scale and Magnitude

Logarithms are essential for understanding phenomena that span multiple orders of magnitude. A practical tip is to visualize them as a way to turn multiplication into addition, making extremely large or small numbers manageable. In acoustics, we use the decibel scale, a logarithmic unit, because the human ear perceives sound intensity over a range of trillions to one. Instead of dealing with massive raw numbers, logs allow us to work within a simple, linear 0 to 140 scale.

Overcoming Mathematical Hurdles

The most frequent mistake is attempting to take the logarithm of a negative number or zero. In the realm of real numbers, these values are undefined because no positive base raised to any power can result in a negative value. Another error is misapplying the 'change of base' formula. Since most basic calculators only have 'log' and 'ln' buttons, you must divide the log of your number by the log of the desired base to get the correct result.

Logs in Finance and Data Science

In finance, logarithms are used to calculate 'log returns,' which are preferred for time-series analysis because they are additive across different periods. Data scientists also use log transforms to normalize skewed datasets, making it easier for machine learning models to identify patterns. This is particularly useful in data where most values are small but a few are extremely large, such as household income distributions or the populations of major cities worldwide.

Frequently asked questions

No real power of a positive base gives zero or a negative number, so the logarithm isn't defined there (in real numbers).

Related calculators