It is aimed to compare whether there are differences in endoplasmic reticulum stress, liver function, insulin resistance, and vascular endothelial function in patients with nonalcoholic fatty liver disease (NAFLD) with and without type 2 diabetes mellitus (T2DM). Forty patients with NAFLD, 38 patients with NAFLD combined with T2DM, and 30 patients with normal liver tissue were selected. They were set as Group A, Group B and Group C respectively. The expression level of glucose-regulated protein 94 (GRP94) and biochemical indicators such as alanine aminotransferase (ALT), free fatty acids (FFA), triglycerides (TG), gamma-glutamyl transferase (GGT), aspartate aminotransferase (AST), fasting blood glucose (FBG), and fasting insulin (FINS) were measured. Also, the calculation of the homeostatic model assessment for insulin resistance (HOMA-IR) index was performed. The reactive hyperemia index (RHI) was detected to evaluate the vascular endothelial function of patients. The comparison between groups and multi-factor analysis of the influencing factors of RHI was conducted. Compared with Group C, the expressions in Group A and Group B were distinctly enhanced (P <0.05). Also, the expression of GRP94 protein in Group B was distinctly higher than that in Group A (P <0.05). The average optical density values of Groups A, B, and C were 0.327 ± 0.007, 0.350 ± 0.009, and 0.299 ± 0.006, respectively. A comparison between the three groups was performed. The differences had statistical significance (P <0.05). The differences in the TG, ALT, AST, GGT, FINS and HOMA-IR between Group A and Group B had statistical significance (P <0.05). The RHI values of Groups A, B, and C were 1.59 ± 0.23, 1.79 ± 0.32, and 2.05 ± 0.47, respectively. A comparison between the three groups was performed. The differences had statistical significance (P <0.05). FFA, ALT and FBG in patients with NAFLD are risk factors for endothelial dysfunction (P <0.05). The liver damage caused by NAFLD may be related to the expression of GRP94. FFA, ALT and FBG are risk factors for endothelial dysfunction in NAFLD patients.