Background and Aims: Accurately predicting the response to methotrexate (MTX) in juvenile idiopathic arthritis (JIA) patients before administration is the key point to improve the treatment outcome. However, no simple and reliable prediction model has been identified. Here, we aimed to develop and validate predictive models for the MTX response to JIA using machine learning based on electronic medical record (EMR) before and after administering MTX.Materials and Methods: Data of 362 JIA patients with MTX mono-therapy were retrospectively collected from EMR between January 2008 and October 2018. DAS44/ESR-3 simplified standard was used to evaluate the MTX response. Extreme gradient boosting (XGBoost), support vector machine (SVM), random forest (RF), and logistic regression (LR) algorithms were applied to develop and validate models with 5-fold cross-validation on the randomly split training and test set. Data of 13 patients additionally collected were used for external validation.Results: The XGBoost screened out the optimal 10 pre-administration features and 6 mix-variables. The XGBoost established the best model based on the 10 pre-administration variables. The performances were accuracy 91.78%, sensitivity 90.70%, specificity 93.33%, AUC 97.00%, respectively. Similarly, the XGBoost developed a better model based on the 6 mix-variables, whose performances were accuracy 94.52%, sensitivity 95.35%, specificity 93.33%, AUC 99.00%, respectively.Conclusion: Based on common EMR data, we developed two MTX response predictive models with excellent performance in JIA using machine learning. These models can predict the MTX efficacy early and accurately, which provides powerful decision support for doctors to make or adjust therapeutic scheme before or after treatment.