Type 2 Diabetes Mellitus (T2DM) continues to be an important global health problem. Improving the quickness and accuracy of predicting the association between age differences and risk factors for T2DM will significantly improve the efficacy and effectiveness of therapeutic interventions. This study was designed to analyse risk factor of age difference in T2DM hospitalized patients using demographic, clinical and haematological parameters using machine learning.A retrospective study was conducted at PKU Muh Gamping Yogyakarta from January 2021 to July 2023. The demographics, clinical , laboratory finding of the 678 T2DM hospitalized patients were collected. Predictive models were constructed and compared using six supervised machine learning algorithms: decision tree, random forest, adaboost, naïve bayes, SVM and logistics regression using 10-fold cross-validation. The performance of algorithms was assessed using accuracy, precision, sensitivity, and receiver operating characteristic curve (ROC). Gain Ratio Attribute evaluation was used to identify rank and best predictor. WEKA 3.8.6 were used for analysis .Random Forest has the best performance compared to others with an accuracy 72,14% , precision 72,8% , sensitivity 72,1% and ROC 78,1% , lymphocyte was the best predictor. Random forest is recommended for further investigation using larger dataset to asses better result.