Thyroid cancer (TC) incidence has increased greatly during the past decades with a few established risk factors, while no study is available that has assessed the association of the Chinese Health Dietary Index (CHDI) with TC. We conducted a 1:1 matched case–control study in two hospitals in Shanghai, China. Diet-quality scores were calculated according to CHDI using a validated and reliable FFQ. Conditional logistic regression analysis and restricted cubic spline analysis were used to reveal potential associations between CHDI score and TC risk. A total of 414 pairs of historically confirmed TC patients and healthy controls were recruited from November 2012 to December 2015. The total score of cases and controls were 67·5 and 72·8, respectively (P < 0·001). The median score of total vegetables, fruit, diary products, dark green and orange vegetables, fish, shellfish and mollusk, soyabean, whole grains, dry bean and tuber in cases was significantly lower than those in controls. Compared with the reference group (≤60 points), the average (60–80 points) and high (≥80 points) levels of the CHDI score were associated with a reduced risk of TC (OR: 0·40, 95 % CI 0·26, 0·63 for 60–80 points; OR: 0·22, 95 % CI 0·12, 0·38 for ≥80 points). In age-stratified analyses, the favourable association remained significant among participants who are younger than 50 years old. Our data suggested that high diet quality as determined by CHDI was associated with lower risk of TC.