Male infertility is a major reproductive health problem that contributes to approximately half of infertility cases among couples of reproductive age. Accurate evaluation of male fertility status commonly relies on semen analysis, including parameters such as semen volume, sperm concentration, motility, morphology, and vitality. However, manual interpretation of these parameters remains time-consuming and is highly dependent on clinical expertise. This study aims to compare the performance of the XGBoost and Random Forest algorithms in predicting male fertility status based on semen analysis parameters. The study employed a secondary dataset consisting of 1,000 semen analysis records with 11 predictor variables and one target variable representing fertility status. Data preprocessing included categorical encoding, data cleaning, and an 80:20 train–test split before model development and evaluation using accuracy, precision, recall, F1-score, and ROC-AUC. Experimental results showed that XGBoost outperformed Random Forest, achieving an accuracy of 99.00%, precision of 100.00%, recall of 96.88%, F1-score of 98.41%, and ROC-AUC of 99.86%, while Random Forest achieved an accuracy of 97.50%. Feature importance analysis identified Total Motility, Vitality, and Progressive Motility as the most influential predictors of male fertility status. The main contribution of this study is the direct empirical comparison of Random Forest and XGBoost under identical experimental settings using comprehensive semen analysis parameters, providing evidence on the relative effectiveness of ensemble learning algorithms for male fertility status prediction. Although the proposed model demonstrates excellent predictive performance, it was developed using secondary data and is intended to support, rather than replace, clinical decision-making. Future studies should validate the model using larger multicenter clinical datasets to improve its generalizability and practical applicability.