What This Calculator Does
This tool evaluates the logarithm of any positive value b in any valid base a. Standard calculators usually only offer base 10 (log) and base e (ln). With the change-of-base formula, you can compute a logarithm in any base — base 2 for computer science, base 16, or any custom base you need.
How to Use It
Enter the base a (any positive number other than 1) and the value b (any positive number). The calculator returns \(\log_a(b)\), along with the intermediate natural logarithms \(\ln(b)\) and \(\ln(a)\) so you can verify the work. The result answers the question: "To what power must I raise a to get b?"
The Formula Explained
The change-of-base formula states that $$\log_a(b) = \frac{\ln(b)}{\ln(a)}$$ Because natural logarithms (or any fixed-base logs) are available on every scientific calculator, dividing \(\ln(b)\) by \(\ln(a)\) converts the result into base a. The same result is obtained using log base 10: $$\log_a(b) = \frac{\log(b)}{\log(a)}$$ The ratio is identical regardless of the intermediate base used.
Worked Example
Suppose you want \(\log_2(8)\). Using the formula: \(\ln(8) \approx 2.0794415\) and \(\ln(2) \approx 0.6931472\). Dividing gives $$\frac{2.0794415}{0.6931472} = 3$$ This makes sense because \(2^3 = 8\). Another example: $$\log_5(125) = \frac{\ln(125)}{\ln(5)} = \frac{4.8283137}{1.6094379} = 3$$ since \(5^3 = 125\).
Common Logarithm Values Reference Table
The table lists \(\log_a(b)\) for the three most common bases: 2 (binary), e ≈ 2.71828 (natural, written ln) and 10 (common). Non-integer entries are rounded to 4 decimal places. Each value follows from \(\log_a(b)=\ln(b)/\ln(a)\).
| Value (b) | log2(b) | ln(b) (base e) | log10(b) |
|---|---|---|---|
| 1 | 0 | 0 | 0 |
| 2 | 1 | 0.6931 | 0.3010 |
| 4 | 2 | 1.3863 | 0.6021 |
| 8 | 3 | 2.0794 | 0.9031 |
| 10 | 3.3219 | 2.3026 | 1 |
| 100 | 6.6439 | 4.6052 | 2 |
| 1000 | 9.9658 | 6.9078 | 3 |
| 1024 | 10 | 6.9315 | 3.0103 |
Also, \(\ln(e)=1\). For example, \(\log_2(10)=\ln(10)/\ln(2)=2.3026/0.6931 \approx\) 3.3219. Exact integer results (such as \(\log_2(1024)=10\) because \(2^{10}=1024\)) occur only when b is an integer power of a.
Key Terms and Logarithm Rules
- Base (a)
- The number being raised to a power. It must be positive and not equal to 1.
- Argument (b)
- The positive number whose logarithm is taken; also called the value.
- Logarithm
- The exponent x such that \(a^x=b\); written \(x=\log_a(b)\).
- Natural logarithm (ln)
- The logarithm with base e ≈ 2.71828, written \(\ln(b)=\log_e(b)\).
- Common logarithm (log10)
- The logarithm with base 10. It is often written simply as log in calculators and many textbooks.
Core identities
For valid bases and positive arguments:
- \(\log_a(1)=0\)
- \(\log_a(a)=1\)
- Product rule: \(\log_a(xy)=\log_a(x)+\log_a(y)\)
- Quotient rule: \(\log_a\!\left(\frac{x}{y}\right)=\log_a(x)-\log_a(y)\)
- Power rule: \(\log_a(x^k)=k\,\log_a(x)\)
- Reciprocal rule: \(\log_a(b)=\dfrac{1}{\log_b(a)}\) (for \(b\neq 1\))
- Change of base: \(\log_a(b)=\dfrac{\ln(b)}{\ln(a)}=\dfrac{\log_{10}(b)}{\log_{10}(a)}\)
Example of the product rule: \(\log_{10}(200)=\log_{10}(2)+\log_{10}(100)\approx 0.3010+2=2.3010\).
FAQ
Why must the base be positive and not equal to 1? Logarithms are only defined for positive bases other than 1. A base of 1 would make \(\ln(a) = 0\), causing division by zero.
Can b be negative or zero? No. The logarithm of a non-positive number is undefined in the real numbers, so b must be greater than 0.
Is the answer the same whether I divide by ln or log? Yes. \(\log_a(b)\) is the same whether you use natural logs or base-10 logs in the ratio — the choice of intermediate base cancels out.