A measurement of the energy density in proton–proton collisions at a centre-of-mass energy of $$\sqrt{s} =13$$ $$\,\text {TeV}$$ is presented. The data have been recorded with the CMS experiment at the LHC during low luminosity operations in 2015. The energy density is studied as a function of pseudorapidity in the ranges $$-\,6.6<\eta <-\,5.2$$ and $$3.15<|\eta |<5.20$$ . The results are compared with the predictions of several models. All the models considered suggest a different shape of the pseudorapidity dependence compared to that observed in the data. A comparison with LHC proton–proton collision data at $$\sqrt{s} =0.9$$ and $$7\,\text {TeV} $$ confirms the compatibility of the data with the hypothesis of limiting fragmentation.