The emerging field of high energy atmospheric physics (HEAP) includes terrestrial gamma-ray flashes, electron-positron beams and gamma-ray glows from thunderstorms. Similar emissions of high energy particles occur in pulsed high voltage discharges. Understanding these phenomena requires appropriate models for the interaction of electrons, positrons and photons of up to 40MeV energy with atmospheric air. In this paper, we benchmark the performance of the Monte Carlo codes Geant4, EGS5 and FLUKA developed in other fields of physics and of the custom-made codes GRRR and MC-PEPTITA against each other within the parameter regime relevant for high energy atmospheric physics. We focus on basic tests, namely on the evolution of monoenergetic and directed beams of electrons, positrons and photons with kinetic energies between 100keV and 40MeV through homogeneous air in the absence of electric and magnetic fields, using a low energy cutoff of 50keV. We discuss important differences between the results of the different codes and provide plausible explanations. We also test the computational performance of the codes. The Supplement contains all results, providing a first benchmark for present and future custom-made codes that are more flexible in including electrodynamic interactions.