The mammalian neocortex contains many cell types, but whether they organize into repeated structures has been unclear. We discovered that major cell types in neocortical layer 5 form a lattice structure in many brain areas. Large-scale three-dimensional imaging revealed that distinct types of excitatory and inhibitory neurons form cell type–specific radial clusters termed microcolumns. Thousands of microcolumns, in turn, are patterned into a hexagonal mosaic tessellating diverse regions of the neocortex. Microcolumn neurons demonstrate synchronized in vivo activity and visual responses with similar orientation preference and ocular dominance. In early postnatal development, microcolumns are coupled by cell type–specific gap junctions and later serve as hubs for convergent synaptic inputs. Thus, layer 5 neurons organize into a brainwide modular system, providing a template for cortical processing.