This study aimed to examine comorbidity associations across age groups of inpatients with endocrine diseases as the primary diagnosis throughout the life cycle to develop an effective management strategy. Data were obtained from the Korean National Hospital Discharge In-depth Injury Survey (KNHDS) from 2006 to 2021, involving 68,515 discharged patients aged ≥ 19 years with a principal diagnosis of endocrine disease. A database was constructed for analysis, extracting general characteristics and comorbidities. Employing R version 4.2.3, the Chi-squared test and the Apriori algorithm of ARM (association rule mining) were used for analyzing general characteristics and comorbidity associations. There were more women (53.1%) than men (46.9%) (p < 0.001, with women (61.2 ± 17.2) having a higher average age than men (58.6 ± 58.6) (p < 0.001). Common comorbidities include unspecified diabetes mellitus; essential (primary) hypertension; unspecified diabetes mellitus; and other disorders of fluid, electrolyte, and acid-base balance. Notably, type 2 diabetes mellitus, disorders of lipoprotein metabolism and other lipidemia, polyneuropathy in diseases classified elsewhere, retinal disorders in diseases classified elsewhere, and essential (primary) hypertension prevail across all age groups. Association rules further highlight specific comorbidities appearing selectively in certain age groups. In conclusion, establishing a management strategy for comorbidities in patients with a primary diagnosis of an endocrine disorder is necessary.