The relationship between neurons' input and spiking output is central to brain computation. Studies in vitro and in anesthetized animals suggest that nonlinearities emerge in cells' input-output (IO; activation) functions as network activity increases, yet how neurons transform inputs in vivo has been unclear. Here, we characterize cortical principal neurons' activation functions in awake mice using two-photon optogenetics. We deliver fixed inputs at the soma while neurons' activity varies with sensory stimuli. We find that responses to fixed optogenetic input are nearly unchanged as neurons are excited, reflecting a linear response regime above neurons' resting point. In contrast, responses are dramatically attenuated by suppression. This attenuation is a powerful means to filter inputs arriving to suppressed cells, privileging other inputs arriving to excited neurons. These results have two major implications. First, somatic neural activation functions in vivo accord with the activation functions used in recent machine learning systems. Second, neurons' IO functions can filter sensory inputs-not only do sensory stimuli change neurons' spiking outputs, but these changes also affect responses to input, attenuating responses to some inputs while leaving others unchanged.