Measurements of the differential cross section for the Drell-Yan process, based on proton-proton collision data at a centre-of-mass energy of 13 TeV, collected by the CMS experiment, are presented. The data correspond to an integrated luminosity of 2.8 (2.3) fb−1 in the dimuon (dielectron) channel. The total and fiducial cross section measurements are presented as a function of dilepton invariant mass in the range 15 to 3000 GeV, and compared with the perturbative predictions of the standard model. The measured differential cross sections are in good agreement with the theoretical calculations. [Figure not available: see fulltext.].