Benford's law (to base $B$) for an infinite sequence $\{x_k: k \ge 1\}$ of positive quantities $x_k$ is the assertion that $\{ \log_B x_k : k \ge 1\}$ is uniformly distributed $(\bmod\ 1)$. The $3x+1$ function $T(n)$ is given by $T(n)=(3n+1)/{2}$ if $n$ is odd, and $T(n)= n/2$ if $n$ is even. This paper studies the initial iterates $x_k= T^{(k)}(x_0)$ for $1 \le k \le N$ of the $3x+1$ function, where $N$ is fixed. It shows that for most initial values $x_0$, such sequences approximately satisfy Benford's law, in the sense that the discrepancy of the finite sequence $\{\log_B x_k: 1 \le k \le N \}$ is small.