The glutamatergic and GABAergic neurons in the ventral tegmental area (VTA) and substantia nigra pars compacta (SNc) mediated diverse brain functions. However, their whole-brain neural connectivity has not been comprehensively mapped. Here we used the virus tracers to characterize the whole-brain inputs and outputs of glutamatergic and GABAergic neurons in VTA and SNc. We found that these neurons received similar inputs from upstream brain regions, but some quantitative differences were also observed. Neocortex and dorsal striatum provided a greater share of input to VTA glutamatergic neurons. Periaqueductal gray and lateral hypothalamic area preferentially innervated VTA GABAergic neurons. Specifically, superior colliculus provided the largest input to SNc glutamatergic neurons. Compared to input patterns, the output patterns of glutamatergic and GABAergic neurons in the VTA and SNc showed significant preference to different brain regions. Our results laid the anatomical foundation for understanding the functions of cell-type-specific neurons in VTA and SNc.