We consider Hermitian and symmetric random band matrices $H = (h_{xy})$ in $d \geq 1$ dimensions. The matrix entries $h_{xy}$, indexed by $x,y \in (\bZ/L\bZ)^d$, are independent, centred random variables with variances $s_{xy} = \E |h_{xy}|^2$. We assume that $s_{xy}$ is negligible if $|x-y|$ exceeds the band width $W$. In one dimension we prove that the eigenvectors of $H$ are delocalized if $W\gg L^{4/5}$. We also show that the magnitude of the matrix entries $\abs{G_{xy}}^2$ of the resolvent $G=G(z)=(H-z)^{-1}$ is self-averaging and we compute $\E \abs{G_{xy}}^2$. We show that, as $L\to\infty$ and $W\gg L^{4/5}$, the behaviour of $\E |G_{xy}|^2$ is governed by a diffusion operator whose diffusion constant we compute. Similar results are obtained in higher dimensions.