To solve $2^x = 8$ you ask, "2 to what power is 8?" A logarithm is the name for that answer. It is the inverse of the exponential function.
Key idea
$\log_b x$ is the exponent you put on $b$ to get $x$: $\log_b x = y$ means $b^y = x$ (with $b > 0$, $b \ne 1$, $x > 0$). Special names: $\log x$ means $\log_{10} x$ and $\ln x$ means $\log_e x$.
Why it works
Because $b^x$ is one-to-one, every positive number is $b$ to exactly one power. So "the exponent that gives $x$" is well defined, and that defines a function. A logarithm is an exponent: $\log_2 8 = 3$ because $2^3 = 8$. Logs count how many factors of $b$ make $x$, including fractional and negative counts: $\log_2 \frac{1}{8} = -3$ and $\log_4 2 = \frac{1}{2}$.
Worked examples
Worked example: Whole-number answers
Evaluate $\log_3 81$ and $\log 1000$.
- $3^4 = 81$, so $\log_3 81 = 4$.
- $10^3 = 1000$, so $\log 1000 = 3$.
Answer: $4$ and $3$
Worked example: Negative and fractional answers
Evaluate $\log_2 \frac{1}{16}$ and $\log_9 27$.
- $\frac{1}{16} = 2^{-4}$, so $\log_2 \frac{1}{16} = -4$.
- $9 = 3^2$ and $27 = 3^3$. If $9^y = 27$ then $3^{2y} = 3^3$, so $y = \frac{3}{2}$.
Answer: $-4$ and $\frac{3}{2}$
Worked example: Facts that are always true
Evaluate $\log_5 1$, $\log_5 5$ and $\ln e^7$.
- $5^0 = 1$, $5^1 = 5$, and $e^7 = e^7$.
Answer: $0$, $1$ and $7$
Common mistake
Reading $\log_2 8$ as $2 \cdot 8$ or $8 \div 2$. A log is not multiplication or division; it answers "what exponent?" Check by raising the base to your answer: $2^3 = 8$, so $\log_2 8 = 3$.