Through machine learning we identified FOSB, GPAT3, RGCC and RNF43 were the key diagnostic genes for NAFLD, and they were further demonstrated by a receiver operating characteristic curve analysis. Here, RNF43 is linked to metabolic dysfunction-associated steatotic liver disease.