Intensity‐modulated proton therapy (IMPT) can produce plans with similar target dose conformity but lower normal tissue dose than intensity‐modulated X‐ray therapy (IMXT). However, due to the finite range of proton beams in tissue, proton therapy treatment plans are usually more sensitive to setup uncertainties than X‐ray therapy plans. In this work, the energy margin (EM) concept, which was initially developed for passive scattering proton therapy, was generalized to apply to IMPT treatment planning. The effectiveness of the EM method was evaluated on five head‐and‐neck cancer patients with distal edge tracking (DET) treatment plans by comparing the original plans (ORG) without an EM to those with an EM. Three beam arrangements were considered: 24 beams delivered over a 360° arc, 12 beams delivered over a 180° arc, and 12 beams delivered over two 90° fan angles. Setup uncertainty was modeled by sampling rigid translational shifts from a Gaussian distribution with a mean of 0 mm and standard deviation of 2 mm in all directions. Delivered dose distributions for all 30 fractions were recalculated using the Geant4 Monte Carlo code. Normalized total dose (NTD) for both the CTV and a ring structure surrounding the PTV were recorded. The plan quality comparison revealed that EM plans had the same CTV coverage but higher dose to the normal tissue than ORG plans. After the simulated delivery, ORG plans resulted in more than 3% underdosage to 5% of the CTV volume in all three beam arrangements, whereas the EM plans did not. Both ORG and EM plans did not produce more than 5% overdose to D2% of the ring structure. The use of an EM for IMPT treatment planning can substantially reduce sensitivity of the resulting dose distributions to setup uncertainty.PACS number: 87.55.K‐