Background Excessive intake of both fluorine and iodine can lead to various health effects. The potential influence of excessive fluorine and iodine intake on the intelligence of school-age children has become a notable concern. Objectives To investigate the relationship between urinary fluoride (UF) levels, urinary iodine (UI) levels, and intelligence quotient (IQ). Methods This study involved 711 children aged 8 to 12 from rural Jiangsu, China. Water iodine levels were measured using As3+-Ce4+ catalytic spectrophotometry, while UI levels were determined using inductively coupled plasma mass spectrometry. Fluoride levels in urine and drinking water were measured using the ion-selective electrode method. Children's cognitive function, evaluated through IQ scores, was assessed using the Combined Raven's Test. The results were considered significant at the P < 0.05 level. Results The average IQ score was 107.6, the median UF was 281 <mu>g/L, and the median UI was 1.39 mg/L. The correlation coefficient (beta) and confidence interval (95%CI) for UF and UI on IQ were - 3.34 (-4.14, -2.43) and - 3.31 (-4.19, -2.41), respectively (P < 0.001, P < 0.001). UF > 1.4 mg/L and UI >= 300 mu g/L were negatively correlated with IQ scores in all school-age children (P < 0.001, P < 0.001), with beta and 95% CIs of -3.59 (-5.45, -1.74), -4.06 (-5.91, -2.21), respectively. The interaction term (UF > 1.4 mg/L: UI >= 300 mu g/L) was negatively correlated with IQ scores in all (P = 0.041) and female school-age children (P = 0.007), with beta and 95%CIs of -4.43 (-8.66, -0.19) and - 8.87 (-15.16, -2.40), respectively. Conclusions High levels of both fluoride and iodine intake negatively affect the IQ of school-age children. Monitoring and regulating these elements in children's diets is essential to prevent cognitive impairment.