Logarithm Calculator

Free logarithm calculator. Compute the logarithm of a number with any base, including the common log (base 10), natural log (base e), and binary log (base 2).

AI-ready Use this tool with AI

This tool has a free JSON API. Copy a prompt or skill below to use it with ChatGPT, Claude, or any AI agent โ€” no API key needed.

API docs
โ€”
Enter a value and base above.

How logarithm calculator works

A logarithm answers the question "what power do I raise this base to in order to get this number?" The base-10 log of 1000 is 3, because 10^3 = 1000. The natural log (ln) uses base e (about 2.718) and is central to calculus and exponential growth. The binary log (base 2) appears in computing and information theory.

This calculator uses the change-of-base formula log_b(x) = ln(x) / ln(b), so it works for any positive base other than 1. It defaults to base 10 and recognises the special cases: base 10 reports the common log, base e the natural log, and base 2 the binary log.

Enter a value and a base and the tool returns the logarithm. The value must be positive, and the base must be positive and not equal to 1. Use it for algebra homework, science, decibel and pH calculations (which use log10), and bit-depth or doubling-time problems (which use log2).

Frequently asked questions

What is the change-of-base formula?
log_b(x) = ln(x) / ln(b). It lets you compute a logarithm in any base using the natural log, which is what this calculator does internally.
What are the common logs?
log10 (base 10) is the common logarithm, used in decibels and pH. ln (base e) is the natural logarithm, used in calculus and growth. log2 (base 2) is the binary logarithm, used in computing and information.
Why must the value be positive?
A logarithm is only defined for positive numbers in real arithmetic โ€” there is no real power that makes a positive base produce zero or a negative result. The calculator rejects non-positive values.
Why can the base not be 1?
Because 1 to any power is 1, a base-1 "logarithm" has no solution for any value other than 1 and is undefined. The calculator rejects a base of 1.