The ALICE Collaboration at the CERN LHC has measured the inclusive production cross section of isolated photons at midrapidity as a function of the photon transverse momentum ( $$p_{\textrm{T}}^{\gamma }$$ p T γ ), in Pb–Pb collisions in different centrality intervals, and in pp collisions, at centre-of-momentum energy per nucleon pair of $$\sqrt{s_{\textrm{NN}}}~=~5.02$$ s NN = 5.02 TeV. The photon transverse momentum range is between 10–14 and 40–140 GeV/ $$c$$ c , depending on the collision system and on the Pb–Pb centrality class. The result extends to lower $$p_{\textrm{T}}^{\gamma }$$ p T γ than previously published results by the ATLAS and CMS experiments at the same collision energy. The covered pseudorapidity range is $$|\eta ^{\gamma } |