The CRISPR–Cas9 system is a powerful genome-editing tool useful in a variety of biotechnology and biomedical applications. Here we developed a synthetic RNA-based, microRNA (miRNA)-responsive CRISPR–Cas9 system (miR-Cas9 switch) in which the genome editing activity of Cas9 can be modulated through endogenous miRNA signatures in mammalian cells. We created miR-Cas9 switches by using a miRNA-complementary sequence in the 5΄-UTR of mRNA encoding Streptococcus pyogenes Cas9. The miR-21-Cas9 or miR-302-Cas9 switches selectively and efficiently responded to miR-21-5p in HeLa cells or miR-302a-5p in human induced pluripotent stem cells, and post-transcriptionally attenuated the Cas9 activity only in the target cells. Moreover, the miR-Cas9 switches could differentially control the genome editing by sensing endogenous miRNA activities within a heterogeneous cell population. Our miR-Cas9 switch system provides a promising framework for cell-type selective genome editing and cell engineering based on intracellular miRNA information.