Loneliness and social isolation were associated with an elevated risk of NAFLD, independent of other important risk factors.