The 5' end of each polymerase II transcript is capped by a methylated guanosine triphosphate. The cap earmarks the mRNA for subsequent processing and nucleocytoplasmic transport, protects the mRNA from degradation and promotes efficient initiation of protein synthesis. The recently solved structures of capping enzymes and cap-protein complexes shed light on how the 5' ends of mRNAs are modified, and reveals the mechanisms by which the cap is recognized and how it functions in a diverse range of processes.