We aimed (i) evaluating the relationship between non-alcoholic fatty liver disease (NAFLD) and thyroid function tests, (ii) testing if the relationship between NAFLD and thyroid dysfunction could be driven by the obesity and the IR degree, and (iii) exploring the influence of the patatin-like phospholipase domain-containing protein-3 (PNPLA3) I148Mand the transmembrane 6 superfamily member 2 (TM6SF2) E167K polymorphisms on the association between NAFLD and thyroid function in children. We examined 2275 children and adolescents with obesity. Subclinical hypothyroidism (SH) was defined by thyroid-stimulating hormone (TSH) > 4.2μUI/ml with normal fT3 and fT4. Children with NAFLD showed higher SH prevalence than those without NAFLD (15.7% Vs 7.4%;p = 0.001) and showed an adjusted odds ratio (aOR) to have SH of 1.68 (95% CI:1.01-2.80;p = 0.04) while patients with SH had an aOR to show NAFLD of 2.13(95% CI:1.22-3.73;p = 0.008). Patients having severe obesity and IR degree presented an aOR to show both NAFLD and SH of 3.61 (95% CI:1.78-7.33;p < 0.0001). Subjects with NAFLD carrying the TM6SF2 167K allele had lower TSH levels than non-carriers (p = 0.03) and showed an aOR to have SH of 0.10 (95% CI: 0.01-0.79;p = 0.02). No differences were found in carriers of the PNPLA3 148M allele. A general linear model for TSH variance showed a significant association of TSH with TM6SF2 genotypes only in the NAFLD group (p = 0.001). Children with obesity and NAFLD presented increase risk of SH and vice versa likely due to the adverse effect of duration of obesity, obesity degree, and IR. The TM6SF2 E167K exerts a protective role against SH in children with obesity and NAFLD.