In mammalian cortex, most excitatory inputs occur on dendritic spines, avoiding dendritic shafts. Although spines biochemically isolate inputs, nonspiny neurons can also implement biochemical compartmentalization; so, it is possible that spines have an additional function. We have recently shown that the spine neck can filter membrane potentials going into and out of the spine. To investigate the potential function of this electrical filtering, we used two-photon uncaging of glutamate and compared the integration of electrical signals in spines vs. dendritic shafts from basal dendrites of mouse layer 5 pyramidal neurons. Uncaging potentials onto spines summed linearly, whereas potentials on dendritic shafts reduced each other's effect. Linear integration of spines was maintained regardless of the amplitude of the response, distance between spines (as close as < 2 microm), distance of the spines to the soma, dendritic diameter, or spine neck length. Our findings indicate that spines serve as electrical isolators to prevent input interaction, and thus generate a linear arithmetic of excitatory inputs. Linear integration could be an essential feature of cortical and other spine-laden circuits.