ABSTRACT The origin of the multiwavelength emission from the high-synchrotron-peaked BL Lac 1ES 1218+304 is studied using the data from SwiftUVOT/XRT, NuSTAR, and Fermi-LAT. A detailed temporal and spectral analysis of the data observed during 2008–2020 in the γ-ray (>100 MeV), X-ray (0.3–70 keV), and optical/UV bands is performed. The γ-ray spectrum is hard with a photon index of 1.71 ± 0.02 above 100 MeV. The SwiftUVOT/XRT data show a flux increase in the UV/optical and X-ray bands; the highest 0.3–3 keV X-ray flux was (1.13 ± 0.02) × 10−10 erg cm−2 s−1. In the 0.3–10 keV range, the averaged X-ray photon index is >2.0 which softens to 2.56 ± 0.028 in the 3–50 keV band. However, in some periods, the X-ray photon index became extremely hard (<1.8), indicating that the peak of the synchrotron component was above 1 keV, and so 1ES 1218+304 behaved like an extreme synchrotron BL Lac. The hardest X-ray photon index of 1ES 1218+304 was 1.60 ± 0.05 on MJD 58489. The time-averaged multiwavelength spectral energy distribution is modelled within a one-zone synchrotron self-Compton leptonic model using a broken power law and power law with an exponential cutoff electron energy distributions. The data are well explained when the electron energy distribution is $E_{\rm e}^{-2.1}$ extending up to γbr/cut ≃ (1.7 − 4.3) × 105, and the magnetic field is weak (B ∼ 1.5 × 10−2 G). By solving the kinetic equation for electron evolution in the emitting region, the obtained electron energy distributions are discussed considering particle injection, cooling, and escape.