Targeted genomic manipulation by Cas9 can efficiently generate knockout cells and organisms via error-prone nonhomologous end joining (NHEJ), but the efficiency of precise sequence replacement by homology-directed repair (HDR) is substantially lower. Here we investigate the interaction of Cas9 with target DNA and use our findings to improve HDR efficiency. We show that dissociation of Cas9 from double-stranded DNA (dsDNA) substrates is slow (lifetime ∼6 h) but that, before complete dissociation, Cas9 asymmetrically releases the 3' end of the cleaved DNA strand that is not complementary to the sgRNA (nontarget strand). By rationally designing single-stranded DNA (ssDNA) donors of the optimal length complementary to the strand that is released first, we increase the rate of HDR in human cells when using Cas9 or nickase variants to up to 60%. We also demonstrate HDR rates of up to 0.7% using a catalytically inactive Cas9 mutant (dCas9), which binds DNA without cleaving it.