A bstract The transverse energy ( $$ {E}_{\mathrm{T}}^{\upgamma} $$ <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML"> <mml:msubsup> <mml:mi>E</mml:mi> <mml:mi>T</mml:mi> <mml:mi>γ</mml:mi> </mml:msubsup> </mml:math> ) spectra of photons isolated from other particles are measured using proton-proton (pp) and lead-lead (PbPb) collisions at the LHC at $$ \sqrt{s_{\mathrm{NN}}} $$ <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML"> <mml:msqrt> <mml:msub> <mml:mi>s</mml:mi> <mml:mi>NN</mml:mi> </mml:msub> </mml:msqrt> </mml:math> = 5 . 02 TeV with integrated luminosities of 27.4 pb − 1 and 404 μ b − 1 for pp and PbPb data, respectively. The results are presented for photons with 25 < $$ {E}_{\mathrm{T}}^{\upgamma} $$ <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML"> <mml:msubsup> <mml:mi>E</mml:mi> <mml:mi>T</mml:mi> <mml:mi>γ</mml:mi> </mml:msubsup> </mml:math> < 200 GeV in the pseudorapidity range |η| < 1 . 44, and for different centrality intervals for PbPb collisions. Photon production in PbPb collisions is consistent with that in pp collisions scaled by the number of binary nucleon-nucleon collisions, demonstrating that photons do not interact with the quark-gluon plasma. Therefore, isolated photons can provide information about the initial energy of the associated parton in photon+jet measurements. The results are compared with predictions from the next-to-leading-order jetphox generator for different parton distribution functions (PDFs) and nuclear PDFs (nPDFs). The comparisons can help to constrain the nPDFs global fits.