Measurements of the differential and double-differential Drell–Yan cross sections in the dielectron and dimuon channels are presented. They are based on proton–proton collision data at sqrt{s} = 8,text {TeV} recorded with the CMS detector at the LHC and corresponding to an integrated luminosity of 19.7,text {fb}^{-1}. The measured inclusive cross section in the mathrm{Z} peak region (60–120,text {GeV}), obtained from the combination of the dielectron and dimuon channels, is 1138 pm 8,text {(exp)} pm 25,text {(theo)} pm 30,text {(lumi)} text {,pb} , where the statistical uncertainty is negligible. The differential cross section mathrm{d}sigma /mathrm{d}{}m in the dilepton mass range 15–2000,text {GeV} is measured and corrected to the full phase space. The double-differential cross section mathrm{d}^2sigma /mathrm{d}{}m,mathrm{d}|y | is also measured over the mass range 20 to 1500,text {GeV} and absolute dilepton rapidity from 0 to 2.4. In addition, the ratios of the normalized differential cross sections measured at sqrt{s} = 7 and 8,text {TeV} are presented. These measurements are compared to the predictions of perturbative QCD at next-to-leading and next-to-next-to-leading (NNLO) orders using various sets of parton distribution functions (PDFs). The results agree with the NNLO theoretical predictions computed with fewz 3.1 using the CT10 NNLO and NNPDF2.1 NNLO PDFs. The measured double-differential cross section and ratio of normalized differential cross sections are sufficiently precise to constrain the proton PDFs.