Let pn(y)=∑kα̂kϕ(y−k)+∑l=0jn−1∑kβ̂lk2l/2ψ(2ly−k) be the linear wavelet density estimator, where ϕ, ψ are a father and a mother wavelet (with compact support), α̂k, β̂lk are the empirical wavelet coefficients based on an i.i.d. sample of random variables distributed according to a density p0 on ℝ, and jn∈ℤ, jn↗∞. Several uniform limit theorems are proved: First, the almost sure rate of convergence of sup y∈ℝ|pn(y)−Epn(y)| is obtained, and a law of the logarithm for a suitably scaled version of this quantity is established. This implies that sup y∈ℝ|pn(y)−p0(y)| attains the optimal almost sure rate of convergence for estimating p0, if jn is suitably chosen. Second, a uniform central limit theorem as well as strong invariance principles for the distribution function of pn, that is, for the stochastic processes $\sqrt{n}(F_{n}^{W}(s)-F(s))=\sqrt{n}\int_{-\infty}^{s}(p_{n}-p_{0})$ , s∈ℝ, are proved; and more generally, uniform central limit theorems for the processes $\sqrt{n}\int(p_{n}-p_{0})f$ , $f\in\mathcal{F}$ , for other Donsker classes $\mathcal{F}$ of interest are considered. As a statistical application, it is shown that essentially the same limit theorems can be obtained for the hard thresholding wavelet estimator introduced by Donoho et al. [Ann. Statist. 24 (1996) 508–539].