Dendritic spines receive most synaptic inputs in the forebrain. Their morphology, with a spine head isolated from the dendrite by a slender neck, indicates a potential role in isolating inputs. Indeed, biochemical compartmentalization occurs at spine heads because of the diffusional bottleneck created by the spine neck. Here we investigate whether the spine neck also isolates inputs electrically. Using two-photon uncaging of glutamate on spine heads from mouse layer-5 neocortical pyramidal cells, we find that the amplitude of uncaging potentials at the soma is inversely proportional to neck length. This effect is strong and independent of the position of the spine in the dendritic tree and size of the spine head. Moreover, spines with long necks are electrically silent at the soma, although their heads are activated by the uncaging event, as determined with calcium imaging. Finally, second harmonic measurements of membrane potential reveal an attenuation of somatic voltages into the spine head, an attenuation directly proportional to neck length. We conclude that the spine neck plays an electrical role in the transmission of membrane potentials, isolating synapses electrically.