Nonalcoholic fatty liver disease (NAFLD) has emerged as a major health problem worldwide; according to statistics, 10% to 25% of patients with NAFLD can progress to nonalcoholic steatohepatitis (NASH). A link between the composition and metabolites of intestinal microbiota and the development of NAFLD is becoming clearer. It is believed that microbiota factors are driving forces of hepatic steatosis and inflammation. The formulated food that contains prebiotics and dietary fiber may improve NAFLD by altering the intestinal flora and its metabolites. The study plan to recruit adult patients (18-75 years, n = 120) with NAFLD, range of alanine aminotransferase is 1.5 to 5 times upper limit of normal (ULN) or liver biopsy is confirmed as NASH. Participants will be randomly allocated into 2 groups: formulated food (n = 80) and a placebo group (n = 40) for 24 weeks. Both groups will receive lifestyle and nutritional advice. The primary endpoint is a decrease in MRS-PDFF by more than 30% from baseline at 24 weeks. The secondary endpoints include the change of anthropometric, liver function, glycolipid metabolism, and systemic inflammation at 4, 12, and 24 weeks. In addition, we consider the changes in intestinal microbiota as an exploration to assess the abundance and diversity at 24 weeks. Weeks 24 to 36 are the follow-up period of drug withdrawal. This clinical trial will provide evidence of efficacy and safety of formulated food as a potential new therapeutic agent for NAFLD patients. The trial is registered in the China Clinical Trial Center (ChiCTR1800016178).