Understanding cortical circuits will require mapping the connections between specific populations of neurons, as well as determining the dendritic locations where the synapses occur. The dendrites of individual cortical neurons overlap with numerous types of local and long-range excitatory axons, but axodendritic overlap is not always a good predictor of actual connection strength. Here we developed an efficient channelrhodopsin-2 (ChR2)-assisted method to map the spatial distribution of synaptic inputs, defined by presynaptic ChR2 expression, within the dendritic arborizations of recorded neurons. We expressed ChR2 in two thalamic nuclei, the whisker motor cortex and local excitatory neurons and mapped their synapses with pyramidal neurons in layers 3, 5A and 5B (L3, L5A and L5B) in the mouse barrel cortex. Within the dendritic arborizations of L3 cells, individual inputs impinged onto distinct single domains. These domains were arrayed in an orderly, monotonic pattern along the apical axis: axons from more central origins targeted progressively higher regions of the apical dendrites. In L5 arborizations, different inputs targeted separate basal and apical domains. Input to L3 and L5 dendrites in L1 was related to whisker movement and position, suggesting that these signals have a role in controlling the gain of their target neurons. Our experiments reveal high specificity in the subcellular organization of excitatory circuits.