Background: Sleep disorders are one of the etiologic factors in the development of hypertension, and the risk of hypertension in patients with sleep disorders is increasing due to the increase in the prevalence of sleep disorders in recent years. We hypothesized that machine learning could establish a prediction model for hypertension in patients with sleep disorders. Methods: The data for patients diagnosed with sleep disorders were collected from two hospitals from 2019 to 2023, including medical history and biochemical indicators. After data processing, Logistic Regression, Decision Tree, Artificial Neural Network, Support Vector Machine, Naive Bayes, Adaptive Boosting, Random Forest, and Extreme Gradient Boosting (XGBoost) were selected for training. Five-fold cross-validation was used to evaluate the models, and accuracy, precision, recall, F1-score, and the area under the curve (AUC) were used to verify the discrimination and clinical practicability of the models. SHapley Additive exPlanation (SHAP) was used to explain the optimal model. Results: The XGBoost model was superior to other models, with an accuracy of 0.7216, a precision of 0.7576, a recall of 0.7660, an F1-score of 0.7430, and an AUC of 0.844. The SHAP results showed that age, weight, white blood cells, creatine, uric acid, glycosylated hemoglobin, and platelets were the risk factors of hypertension in people with sleep disorders, while high density lipoprotein cholesterol was a protective factor. Conclusion: Machine learning algorithms established a predictive risk model of hypertension in people with sleep disorders, which provides significant guidance to prevent and treat hypertension in people with sleep disorders.