Thalassemia is an inherited blood disorder. Current diagnostic methods mainly rely on sophisticated equipment and specifically trained technicians. This study aims to identify and genotype thalassemia by applying machine learning (ML) algorithms to routine blood parameters. This study recruited a derivation cohort of 31,311 individuals from four independent hospitals and developed eight machine learning (ML) models for the purpose. The performance of these models was compared using a set of evaluation metrics. An additional cohort of 2000 patients was recruited for external validation to assess the generalization of the models. The results demonstrated that the categorical boosting (CatBoost) model exhibited the best discriminative ability in both the training and external validation cohorts. The model was then integrated into an online platform, which holds the potential to act as an auxiliary tool for identifying and genotyping thalassemia via automatic analysis of routine blood test parameters.