Papillary thyroid carcinoma (PTC) represents the most common subtype of thyroid cancer (TC). This study was set out to explore the potential effect of CHD1L on PTC and type 2 diabetes mellitus (T2DM). We searched for T2DM susceptibility genes through the GWAS database and obtained T2DM-related differentially expressed gene from the GEO database. The expression and clinical data of TC and normal samples were collated from the TCGA database. Receiver operating characteristic (ROC) curve analysis was subsequently applied to assess the sensitivity and specificity of the CHD1L for the diagnosis of PTC. The MCP-counter package in R language was then utilized to generate immune cell score to evaluate the relationship between CHD1L expression and immune cells. Then, we performed functional enrichment analysis of co-expressed genes and DEGs to determine significantly enriched GO terms and KEGG to predict the potential functions of CHD1L in PTC samples and T2DM adipose tissue. From two genes (ABCB9, CHD1L) were identified to be DEGs (p < 1 * 10-5) that exerted effects on survival (HR > 1, p < 0.05) in PTC and served as T2DM susceptibility genes. The gene expression matrix-based scoring of immunocytes suggested that PTC samples with high and low CHD1L expression presented with significant differences in the tumor microenvironment (TME). The enrichment analysis of CHD1L co-expressed genes and DEGs suggested that CHD1L was involved in multiple pathways to regulate the development of PTC. Among them, Kaposi sarcoma-associated herpesvirus infection, salmonella infection and TNF signaling pathways were highlighted as the three most relevant pathways. GSEA analysis, employed to analyze the genome dataset of PTC samples and T2DM adipose tissue presenting with high and low expression groups of CHD1L, suggests that these differential genes are related to chemokine signaling pathway, leukocyte transendothelial migration and TCELL receptor signaling pathway. CHD1L may potentially serve as an early diagnostic biomarker for PTC, and a target of immunotherapy for PTC and T2DM.