The efficiency of pluripotent stem cell differentiation is highly variable, often resulting in heterogeneous populations that contain undifferentiated cells. Here we developed a sensitive, target-specific, and general method for removing undesired cells before transplantation. MicroRNA-302a-5p (miR-302a) is highly and specifically expressed in human pluripotent stem cells and gradually decreases to basal levels during differentiation. We synthesized a new RNA tool, miR-switch, as a live-cell reporter mRNA for miR-302a activity that can specifically detect human induced pluripotent stem cells (hiPSCs) down to a spiked level of 0.05% of hiPSCs in a heterogeneous population and can prevent teratoma formation in an in vivo tumorigenicity assay. Automated and selective hiPSC-elimination was achieved by controlling puromycin resistance using the miR-302a switch. Our system uniquely provides sensitive detection of pluripotent stem cells and partially differentiated cells. In addition to its ability to eliminate undifferentiated cells, miR-302a switch also holds great potential in investigating the dynamics of differentiation and/or reprograming of live-cells based on intracellular information.