The dorsal spinal cord contains a diverse array of neurons that connect sensory input from the periphery to spinal cord motoneurons and brain. During development, six dorsal neuronal populations (dI1-dI6) have been defined by expression of homeodomain factors and position in the dorsoventral axis. The bHLH transcription factors Mash1 and Ngn2 have distinct roles in specification of these neurons. Mash1 is necessary and sufficient for generation of most dI3 and all dI5 neurons. Unexpectedly, dI4 neurons are derived from cells expressing low levels or no Mash1, and this population increases in the Mash1 mutant. Ngn2 is not required for any specific neuronal cell type but appears to modulate the composition of neurons that form. In the absence of Ngn2, there is an increase in the number of dI3 and dI5 neurons, in contrast to the effects produced by activity of Mash1. Mash1 is epistatic to Ngn2, and, unlike the relationship between other neural bHLH factors, cross-repression of expression is not detected. Thus, bHLH factors, particularly Mash1 and related family members Math1 and Ngn1, provide a code for generating neuronal diversity in the dorsal spinal cord with Ngn2 serving to modulate the number of neurons in each population formed.