What This Logarithm Calculator Does
This Logarithm Calculator finds the logarithm of any positive number to any base you choose. You enter two values — the Number and the Base — and the tool instantly returns the logarithm. As a bonus, it also reports two of the most commonly used logarithms of your number: the natural log (base e) and the common log (base 10), so you get three useful results from a single calculation.
The Inputs You Provide
- Number: The value you want the logarithm of (the argument). It must be greater than zero.
- Base: The base of the logarithm — for example, 2 for binary, 10 for common logs, or about 2.71828 for natural logs. The base must be positive and not equal to 1.
The Formula Explained
A logarithm answers the question: "To what power must I raise the base to get the number?" Formally:
$$\log_{b}(x) = y \quad \Leftrightarrow \quad b^{y} = x$$
Because most programming and calculator engines only compute natural logarithms directly, this tool uses the change-of-base rule to handle any base you enter:
$$\log_{b}(x) = \frac{\ln(x)}{\ln(b)}$$
Alongside the main result, it computes the natural log \(\ln(x)\) and the common log \(\log_{10}(x)\) for reference.
Worked Example
Suppose you enter a Number of 8 and a Base of 2. The calculator divides the natural log of 8 by the natural log of 2:
- \(\ln(8) \approx 2.0794\)
- \(\ln(2) \approx 0.6931\)
- $$\text{Result} = \frac{2.0794}{0.6931} = 3$$
This makes sense because \(2^{3} = 8\). The calculator would also show the natural log of 8 (\(\approx 2.0794\)) and the common log of 8 (\(\approx 0.9031\)).
Frequently Asked Questions
Can I calculate a natural or common log here? Yes. For a natural log, set the base to e (\(\approx 2.71828\)); for a common log, set the base to 10. The tool also displays both automatically next to your result.
Why can't I use a number of zero or a negative number? Logarithms are only defined for positive numbers. There is no power you can raise a positive base to that produces zero or a negative value, so those inputs have no real answer.
Why can't the base be 1? Raising 1 to any power always gives 1, so a base of 1 can never equal any other number — the logarithm is undefined and the division would fail.