A measurement of differential cross sections for the production of a pair of isolated photons in proton-proton collisions at [Formula: see text] is presented. The data sample corresponds to an integrated luminosity of 5.0[Formula: see text] collected with the CMS detector. A data-driven isolation template method is used to extract the prompt diphoton yield. The measured cross section for two isolated photons, with transverse energy above 40 and 25[Formula: see text] respectively, in the pseudorapidity range [Formula: see text], [Formula: see text] and with an angular separation [Formula: see text], is [Formula: see text][Formula: see text]. Differential cross sections are measured as a function of the diphoton invariant mass, the diphoton transverse momentum, the azimuthal angle difference between the two photons, and the cosine of the polar angle in the Collins-Soper reference frame of the diphoton system. The results are compared to theoretical predictions at leading, next-to-leading, and next-to-next-to-leading order in quantum chromodynamics.