For an optimal performance, soccer players and referees need to consume a high-quality diet. The Healthy Eating Index (HEI) is a tool that can estimate diet quality and has been shown to be associated with body composition. The aims of the present study were first to determine the HEI-2015 score of the diets consumed by athletes and second its association with different body composition parameters of athletes. We conducted a cross-sectional study on 198 soccer players and referees. Dietary intakes were recorded using a validated food frequency questionnaire (FFQ), and HEI scores were calculated. Body composition parameters were measured using the bioelectrical impedance analysis. The mean score for the HEI-2015 was 65⋅04. A multiple linear regression model showed significant associations of the HEI-2015 score with percent body fat (PBF), percent muscle mass (PMM), waist-to-hip ratio (WHR) and waist-to-height ratio (WHtR) in male soccer players aged <18 years, body mass index (BMI) in male soccer players aged ≥18 years and BMI and waist-to-height ratio (WHtR) in male soccer referees after adjustment for covariates (P < 0⋅05). The mean overall score for the HEI-2015 shows that Iranian soccer players and referees have an acceptable quality of diet. We also found significant associations between the HEI-2015 score and different body composition parameters in male soccer players and referees but we did not find any significant association in female athletes (P > 0⋅05).