ObjectiveOne in five patients with rheumatoid arthritis (RA) rely on surgery to restore joint function. However, variable response to disease‐modifying anti‐rheumatic drugs (DMARDs) complicates surgical planning, and it is difficult to predict which patients may ultimately require surgery. We used machine learning to develop predictive models for a) likelihood of undergoing an operation related to RA, b) which type of operation surgical patients undergo.MethodsWe used electronic health record data to train two extreme gradient boosting machine learning models. The first model predicted patients’ probabilities of undergoing surgery ≥5 years after their initial clinic visit. The second model predicted whether surgical patients would undergo a major joint replacement versus a less intensive procedure. Predictors included demographics, comorbidities, and medication data. The primary outcome was model discrimination, measured by area under the receiver operating characteristic curve (AUC).ResultsWe identified 5,481 patients, of which 278 (5.1%) underwent surgery. There was no significant difference in the frequency of DMARD or steroid prescriptions between patients who did and did not have surgery, though non‐steroidal anti‐inflammatory drug prescriptions were more common among patients who did have surgery (p=0.03). The model predicting use of surgery had an AUC of 0.90±0.02. The model predicting type of surgery had an AUC of 0.58±0.10.ConclusionsPredictive models using clinical data have the potential to facilitate identification of patients who may undergo rheumatoid‐related surgery, but not what type of procedure they will need. Integrating similar models into practice has the potential to improve surgical planning.This article is protected by copyright. All rights reserved.