Cortical information processing relies on synaptic interactions between diverse classes of neurons with distinct electrophysiological and connection properties. Uncovering the operational principles of these elaborate circuits requires the probing of electrical activity from selected populations of defined neurons. Here we show that genetically encoded voltage-sensitive fluorescent proteins (VSFPs) provide an optical voltage report from targeted neurons in culture, acute brain slices and living mice. By expressing VSFPs in pyramidal cells of mouse somatosensory cortex, we also demonstrate that these probes can report cortical electrical responses to single sensory stimuli in vivo. These protein-based voltage probes will facilitate the analysis of cortical circuits in genetically defined cell populations and are hence a valuable addition to the optogenetic toolbox.