The purpose of this study was to assess the risks of hyperthyroidism and hypothyroidism related to gynecological cancers. Population-based retrospective cohort study. We conducted a cohort study using the Taiwan National Health Insurance Research Database to explore hyperthyroidism and hypothyroidism associated with site-specific gynecologic cancers in women from January 1, 2000 to December 31, 2018. The examined gynecologic cancers included endometrial (EC), uterine corpus cancer (UC), and ovarian cancer (OC). The incidence and hazard ratios were quantified using Cox proportional hazards models. The incidence of developing gynecological (Gyn) cancers in the hyperthyroid and hypothyroid women was 0.29 and 0.44 per 1000 person-years, which was 0.86 fold lower and 1.13 fold higher than that in the comparison cohort (p < 0.001). Compared with patients aged 20–40 years, patients in older age groups had a lower and higher risk of developing Gyn cancers (for hyperthyroid, 40–65 years: adjusted hazard ratio (aHR) = 0.82; > 65 years: aHR = 0.94; for hypothyroid, adjusted hazard ratio (aHR) = 1.26; > 65 years: aHR = 1.38). Compared with the non-hypothyroid women and non-hyperthyroid women beyond 6 years of follow-up, hypothyroid and hyperthyroid women showed decreased risk of Gyn cancers. Medication treatment for hyperthyroid and hypothyroid disease did not showed significant association in subgroup analyses (aHR = 0.99 and 0.80, respectively). Our results show that women with hyperthyroidism have a significantly reduced risk of gynecological cancers, whereas women with hypothyroidism have a slightly increased risk of gynecological cancers suggesting an association between thyroid function level and risk of gynecological cancers.