DNA-binding proteins control how genomes function. The theory of facilitated diffusion(1) explains how DNA-binding proteins can find targets apparently faster than the diffusion limit by using reduced dimensionality(2,3)-combining three-dimensional (3D) diffusion through cytoplasm with 1D sliding along DNA (refs 3-15). However, it does not include a description of macromolecular crowding on DNA as observed in living cells. Here, we show that such a physical constraint to sliding greatly reduces the search speed, in agreement with single-molecule measurements. Interestingly, the generalized theory also reveals significant insights into the design principles of biology. First, it places a hard constraint on the total number of DNA-binding proteins per cell. Remarkably, the number measured for Escherichia coli fits within the optimal range. Secondly, it defines a new role for DNA looping, a ubiquitous topological motif in genomes. DNA looping can speed up the search process by bypassing proteins that block the sliding track close to the target.