Nonalcoholic fatty liver disease (NAFLD) is one of the most commonly diagnosed chronic liver diseases in the world and has become an essential public health problem. Introduction of machine learning algorithms to evaluate the best predictive clinical model for NAFLD. In this paper, this study proposes a machine learning Voting algorithm with Genetic Algorithm, Neural Network, Random Forest, and Logistic Regression for NAFLD detection and diagnosis. First, 2,522 of the 10,508 samples met the diagnostic criteria for NAFLD. Visualizing the distribution of missing values, and KNN algorithm is used to fill the missing values. Doing Kolmogorov-Smirnov Z test and the heatmap of 19 variables. The PPFS feature selection method is used to perform the feature selection and the final 11 features are retained. Alanine aminotransferase (ALT), body mass index (BMI), triglycerides (TG), γ-glutamyl transpeptidase (γGT), and Low-density lipoprotein cholesterol (LDL) were the top 5 features contributing to NAFLD. 10 basic machine learning algorithms were used, and the four machine learning algorithms with the highest accuracy were Genetic Algorithm, Neural Network, Random Forest, and Logistic Regression. These four algorithms are fused into the proposed Voting algorithm through the Soft Voting method of Ensemble learning. 10-fold cross-validation was used in the classification. To verify the proposed Voting algorithm, it is compared with other 10 basic machine learning algorithms It achieved accuracy, recall, precision, \({F}_{1}\) score, AUC of up to 0.846212, 0.573248, 0.725806, 0.640569, 0.894010, respectively. According to the results, the proposed Voting algorithm demonstrated the best performance.