A measurement is presented of the production of Formula Presented bosons that decay into two electrons or muons in association with jets, in proton-proton collisions at a center-of-mass energy of 13 TeV. The data were recorded by the CMS Collaboration at the LHC with an integrated luminosity of Formula Presented. The differential cross sections are measured as a function of the transverse momentum (Formula Presented) of the Formula Presented boson and the transverse momentum and rapidities of the five jets with largest Formula Presented. The jet multiplicity distribution is measured for up to eight jets. The hadronic activity in the events is estimated using the scalar sum of the Formula Presented of all the jets. All measurements are unfolded to the stable-particle level and compared with predictions from various Monte Carlo event generators, as well as with expectations at leading and next-to-leading orders in perturbative quantum chromodynamics.