Anemia has emerged as a significant public health issue, typically caused by various factors such as nutritional deficiencies, chronic diseases, and genetic conditions. Identifying individuals at risk for developing anemia presents a major challenge for doctors and public health experts, as different types of anemia are distinguished by unique characteristics. While a simple, affordable, and widely available laboratory test, the complete blood count (CBC), is commonly used to diagnose anemia, it cannot differentiate between the various types. Therefore, the goal of this study is to develop a machine learning model to predict and classify all types of anemia using machine learning algorithms. In medical science, accurate prognosis and classification are vital for halting disease progression and detecting early affected areas. Machine learning (ML) techniques are frequently employed to predict and classify disease susceptibility with high accuracy, serving as a valuable tool for doctors and specialists. In this work, four machine learning algorithms were trained on a dataset to diagnose anemia and non-anemia patients: support vector machine, random forest, decision tree, and extreme gradient boosting classifier models. The XGBoost classifier outperformed the others, utilizing 25 out of 29 features with an accuracy of 0.9998, a precision of 0.9969, a recall of 0.9951, and an F1-score of 0.9960.