Thyroid cancer (THCA) is a malignant tumor that affects the endocrine system. At present, an effective treatment for THCA remains elusive, particularly for medullary carcinoma and undifferentiated carcinoma, due to the lack of suitable medications and prognostic markers. Patient RNA-sequencing and clinical data were obtained from The Cancer Genome Atlas and Genotype-Tissue Expression databases. Protein-protein interaction analyses were performed for differentially expressed genes related to THCA. Moreover, the associations between fibronectin 1 (FN1), clinical data, immune checkpoint genes and immune cell infiltration was assessed. The potential functional role of the FN1 gene was evaluated through gene set enrichment analysis. Immunohistochemistry was used to assess FN1 expression in 103 cases of THCA, comprising 32 with papillary carcinoma, 30 with follicular carcinoma, 35 with medullary carcinoma and 6 with undifferentiated carcinoma. Finally, 11 co-expression modules were constructed and the expression of five identified hub genes (FN1, mucin-1, keratin 19, intracellular adhesion molecule 1 and neural cell adhesion molecule) were evaluated. The results demonstrated that higher FN1 gene expression levels were strongly associated with a higher pathologic stage and tumor stage, and were significantly associated with immune cell infiltration in THCA. Significant increases in FN1 protein expression levels were noted among patients diagnosed with four types of THCA, comprising papillary carcinoma, follicular carcinoma, medullary carcinoma and undifferentiated carcinoma. Patients diagnosed with medullary carcinoma and undifferentiated carcinoma, and with low FN1 expression levels, exhibited a significant survival advantage compared with those with high FN1 expression levels. In conclusion, the present study identified five hub genes involved in the onset and progression of THCA. Furthermore, FN1 could serve as a candidate biomarker and a therapeutic target for THCA and may be a key gene mediating THCA immune infiltration.