AbstractLittle is known about whether diet quality is associated with thyroid function. We aimed to examine the relationship between diet quality and thyroid function. Data were from the National Health and Nutrition Examination Surveys, 2007–2012. A total of 3603 males who were at least 20 years old and had dietary recall data were included in the analysis. Thyroid function was assessed by eight indexes, including total and thyroglobulin antibodies, thyroid peroxidase antibodies, free T4 and T3, total T4 and T3, Tg, and thyroid‐stimulating hormone. Multivariable linear regression, subgroup analyses, and interaction terms were employed to test the association between healthy eating index (HEI) and thyroid function. A total of 3603 male participants aged ≥20 years with an average age of 48.17 ± 0.51 years were enrolled. We found a negative association between HEI‐2010 and total T3 (β = −3.41;p= .01) and free T3 (β = −0.06;p= .01). In subgroup analyses, HEI‐2010 was negatively associated with TT3 in male participants aged <65 years old (β = −4.57;p< .01) and FT3 (β = −0.09;p< .001). Higher HEI‐2010 was inversely associated with lower total T3 and free T3. More well‐designed studies are still needed to validate the causal relationship between HEI and thyroid function.