We introduce a method to select a smoothing factor for kernel density estimation such that, for all densities in all dimensions, the $L_1$ error of the corresponding kernel estimate is not larger than three times
the error of the estimate with the optimal smoothing factor plus a constant times $\sqrt{\log n/n}$, where n is the sample size, and the constant depends only on the complexity of the kernel used in the estimate. The result
is nonasymptotic, that is, the bound is valid for each n. The estimate uses ideas from the minimum distance estimation work of Yatracos. As the inequality is uniform with respect to all densities, the estimate is asymptotically minimax optimal (modulo a constant) over many function classes.