The objective of this research is to analyze the influence of various factors on glycemic control in pediatrics with type 1 diabetes mellitus (T1DM). The study, a cross-sectional analysis, involved 221 T1DM patients below 18 years old who visited our clinic between 2011 and 2020, predating the COVID-19 outbreak. Out of the initial pool, 204 participants were chosen based on specific criteria. By computing odds ratios and 95% confidence intervals, we determined the correlation between these factors and achieving optimal glycemic control (HbA1c < 7.5%). Of the 204 individuals, 55.9% (113 patients) were female. The average age at diagnosis was 6.93 ± 3.9 years. Mean HbA1c (A1C) level of optimal and suboptimal groups were 6.97, 95% CI 6.84 to 7.1 and 8.86, 95% CI 8.68 to 9.03, respectively (p-value < 0.001). Fifty patients had optimal glycemic control and 154 people experienced suboptimal glycemic control during the follow-up that the prevalence of each of them was 24.51, 95% CI 18.7 to 31 and 75.49, 95% CI 68.99 to 81.22, respectively. In the assessment of risk factors associated with suboptimal glycemic control, patients aged 10–14 years had the highest likelihood of experiencing suboptimal glycemic control (crude odds ratio [COR] 3.12, 95% CI 1.04 to 9.3), followed by duration of diabetes (COR 2.85, 95% CI 1.2 to 6.8), which both were significant. By utilizing multivariable logistic regression analysis, a noteworthy finding emerged. It was revealed that patients aged 10–14 years exhibited a significant association with suboptimal glycemic control, [adjusted odds ratio (AOR) 4.85, 95% CI 1.32 to 17.7]. Additionally, a statistically significant correlation was identified between individuals with a body mass index (BMI) falling within the ≥ 95th percentile category and suboptimal glycemic control, Cramer’s V = 0.21, p-value = 0.01. Our research has revealed a significant correlation between patients aged 10–14 years and obese individuals (BMI ≥ 95th) with suboptimal glycemic control. It is crucial to consider these factors as they can offer valuable insights during diagnosis, highlighting the increased risk of long-term suboptimal glycemic control.