This paper presents measurements of charged-hadron spectra obtained in pp, p+Pb, and Pb+Pb collisions at s√
or sNN−−−√
= 5.02 TeV, and in Xe+Xe collisions at sNN−−−√
= 5.44 TeV. The data recorded by the ATLAS detector at the LHC have total integrated luminosities of 25 pb−1, 28 nb−1, 0.50 nb−1, and 3 μb−1, respectively. The nuclear modification factors RpPb and RAA are obtained by comparing the spectra in heavy-ion and pp collisions in a wide range of charged-particle transverse momenta and pseudorapidity. The nuclear modification factor RpPb shows a moderate enhancement above unity with a maximum at pT ≈ 3 GeV; the enhancement is stronger in the Pb-going direction. The nuclear modification factors in both Pb+Pb and Xe+Xe collisions feature a significant, centrality-dependent suppression. They show a similar distinct pT-dependence with a local maximum at pT ≈ 2 GeV and a local minimum at pT ≈ 7 GeV. This dependence is more distinguishable in more central collisions. No significant |η|-dependence is found. A comprehensive comparison with several theoretical predictions is also provided. They typically describe RAA better in central collisions and in the pT range from about 10 to 100 GeV.