Nonalcoholic fatty liver disease (NAFLD) is a risk factor for diabetes and cardiovascular disease that could progress to nonalcoholic steatohepatitis, cirrhosis, and liver failure. We aimed to assess the relationship between NAFLD and lifestyle habits. Using a community-based, cross-sectional design, the records of 11,094 Japanese subjects who had undergone at least 1 annual health checkup were reviewed. Of the 6,370 subjects who qualified for enrolment, 1,346 met the diagnostic criteria for NAFLD. The prevalence rate (PR) of NAFLD increased significantly to 36.6, 41.5, and 41.1 % with no snacking, snacking less than once/day, and snacking ≥2 times/day, respectively, in men (P = 0.0495) and to 10.8, 11.7, and 15.3 %, respectively, in women (P = 0.002). In men, the NAFLD PR decreased significantly to 48.8, 36.9, and 29.9 % with no exercise, exercise consciousness, and periodical exercise, respectively (P < 0.001). In women, the NAFLD PR decreased significantly to 19.3, 13.5, 11, and 8 % with sleep durations of ≤4, 5-6, 7-8, and ≥9 h, respectively (P = 0.003). Periodical exercise was identified as an independent factor associated with NAFLD in men (odds ratio 0.707, 95 % confidence interval 0.546-0.914; P = 0.008). Performing regular exercise was associated with a reduced risk for NAFLD in men. Men with a high risk for NAFLD can be identified using questionnaires on exercise in an outpatient setting. Disease progression and further complications may be prevented by educating high-risk NAFLD patients about the importance of exercise.