CRISPR-Cas9 proteins function within bacterial immune systems to target and destroy invasive DNA and have been harnessed as a robust technology for genome editing. Small bacteriophage-encoded anti-CRISPR proteins (Acrs) can inactivate Cas9, providing an efficient off switch for Cas9-based applications. Here, we show that two Acrs, AcrIIC1 and AcrIIC3, inhibit Cas9 by distinct strategies. AcrIIC1 is a broad-spectrum Cas9 inhibitor that prevents DNA cutting by multiple divergent Cas9 orthologs through direct binding to the conserved HNH catalytic domain of Cas9. A crystal structure of an AcrIIC1-Cas9 HNH domain complex shows how AcrIIC1 traps Cas9 in a DNA-bound but catalytically inactive state. By contrast, AcrIIC3 blocks activity of a single Cas9 ortholog and induces Cas9 dimerization while preventing binding to the target DNA. These two orthogonal mechanisms allow for separate control of Cas9 target binding and cleavage and suggest applications to allow DNA binding while preventing DNA cutting by Cas9.