During perceptual decisions about faint or ambiguous sensory stimuli, even identical stimuli can produce different choices. Spike trains from sensory cortex neurons can predict trial-to-trial variability in choice. Choice-related spiking is widely studied as a way to link cortical activity to perception, but its origins remain unclear. Using imaging and electrophysiology, we found that mouse primary somatosensory cortex neurons showed robust choice-related activity during a tactile detection task. Spike trains from primary mechanoreceptive neurons did not predict choices about identical stimuli. Spike trains from thalamic relay neurons showed highly transient, weak choice-related activity. Intracellular recordings in cortex revealed a prolonged choice-related depolarization in most neurons that was not accounted for by feed-forward thalamic input. Top-down axons projecting from secondary to primary somatosensory cortex signaled choice. An intracellular measure of stimulus sensitivity determined which neurons converted choice-related depolarization into spiking. Our results reveal how choice-related spiking emerges across neural circuits and within single neurons.