Teacher job satisfaction is an important aspect of academic performance, student retention, and teacher retention. We propose to determine the predictive model of job satisfaction of basic education teachers using machine learning techniques. The original data set consisted of 15,087 instances and 942 attributes from the national survey of teachers from public and private educational institutions of regular basic education (ENDO-2018) carried out by the Ministry of Education of Peru. We used the ANOVA F-test filter and the Chi-Square filter as feature selection techniques. In the modeling phase, the logistic regression algorithms, Gradient Boosting, Random Forest, XGBoost and Decision Trees-CART were used. Among the algorithms evaluated, XGBoost and Random Forest stand out, obtaining similar results in 4 of the 8 metrics evaluated, these are: balanced accuracy of 74%, sensitivity of 74%, F1-Score of 0.48 and negative predictive value of 0.94. However, in terms of the area under the ROC curve, XGBoost scores 0.83, while Random Forest scores 0.82. These algorithms also obtain the highest true-positive values (479 instances) and lowest false-negative values (168 instances) in the confusion matrix. Economic income, satisfaction with life, self-esteem, teaching activity, relationship with the director, perception of living conditions, family relationships; health problems related to depression and satisfaction with the relationship with colleagues turned out to be the most important predictors of job satisfaction in basic education teachers.