Log Calculator

Calculate the logarithm of a number for a fixed or custom base, and see what exponent gives that value.

Logarithm formula

The logarithm is the exponent you raise the base to in order to get the number: logb(x) = y means by = x.

The change-of-base formula

Since most calculators (and JavaScript's Math.log) only compute natural logarithms directly, any base is handled using the change-of-base formula: log_b(x) = ln(x) ÷ ln(b). This works for any valid base, which is how this tool supports base 10, base 2, base e (natural log), and any custom base you enter.

Frequently asked questions

What's the difference between log, ln, and log₂? They're the same operation with different bases: "log" conventionally means base 10, "ln" means base e (≈2.71828, the natural logarithm), and log₂ (base 2) is common in computer science for measuring binary quantities like bits.

Why can't the value or base be zero, negative, or 1? Logarithms are only defined for positive values, and a base of 1 would make every logarithm undefined (since 1 raised to any power is always 1, never producing a range of outputs) — these restrictions come directly from the mathematical definition, not an arbitrary limitation of the calculator.

What does the "inverse check" show? It raises the base to the calculated logarithm result, which should return you to (approximately) your original value — a quick way to sanity-check that log and exponentiation are truly inverse operations.