Mammalian lungs are branched networks containing thousands to millions of airways arrayed in intricate patterns that are crucial for respiration. How such trees are generated during development, and how the developmental patterning information is encoded, have long fascinated biologists and mathematicians. However, models have been limited by a lack of information on the normal sequence and pattern of branching events. Here we present the complete three-dimensional branching pattern and lineage of the mouse bronchial tree, reconstructed from an analysis of hundreds of developmental intermediates. The branching process is remarkably stereotyped and elegant: the tree is generated by three geometrically simple local modes of branching used in three different orders throughout the lung. We propose that each mode of branching is controlled by a genetically encoded subroutine, a series of local patterning and morphogenesis operations, which are themselves controlled by a more global master routine. We show that this hierarchical and modular programme is genetically tractable, and it is ideally suited to encoding and evolving the complex networks of the lung and other branched organs.