Aim: our aim was to explore the association between life habits and the controlled attenuation parameter (CAP) and liver stiffness measurements (LSM) as the surrogate markers of liver steatosis and fibrosis in a large cohort of nonalcoholic fatty liver disease (NAFLD) patients. Methods: In this prospective, cross-sectional study we had analyzed 1998 patients with diagnosed NAFLD. Sleeping duration was categorized in three groups: short (S) (<6h), moderate (M) (6-8h) and long (L) (>8h) sleep duration. Coffee drinking was categorized into no (0), moderate (1–2) and frequent (≥3) consumption (in cups/day). Smoking was categorized as yes vs. no. Results: Frequent coffee consumers had the lowest prevalence of obesity, hypertension, dyslipidemia, and diabetes. Furthermore, coffee non-consumers had highest values of hepatic enzymes, CAP and LSM. Moderate sleep duration was associated with lower values of CAP and LSM. Coffee consumption was associated with lower CAP in all the multivariate models (CAP unadjusted and model 1,2 and 3), with largest effect in most frequent coffee consumers (≥3, model 3). Also, most frequent coffee consumers were associated with lower LSM in unadjusted model, model 1 and 2, while this was not the case for model 3 and those who consumed 1-2 cups of coffee per day. Reduced sleeping was confirmed as risk factor for elevated CAP in most of the models (unadjusted and model 1 and 2). Also, negative association of LSM was also confirmed in unadjusted model and model 2. Patients which slept 6-8 hours per day were mostly associated with lower CAP and LSM. Smoking did not affect CAP or LSM values. Conclusion: Coffee consumption has beneficial effect on CAP and LSM and this effect is dose dependent since and independent of a variety of relevant confounders. We have shown that moderate sleep duration has also beneficial effect on CAP and LSM.