Ultrasound elastography has become a promising noninvasive approach for assessing liver fibrosis. The purpose of this study was to evaluate the diagnosis ability of liver stiffness detected by shear wave elastography (SWE) for predicting the presence of esophageal varices (EVs) in cirrhotic patients. Four hundred sixty-eight cirrhotic patients were enrolled consecutively. Liver stiffness and EVs were detected by SWE and endoscopy, respectively. The baseline characteristics were recorded, and areas under the receiver operating characteristic curves (AUROCs) were used to compare the diagnosis accuracy. Multivariate analysis was used to identify the risk factors for EVs in cirrhosis. The mean liver stiffness was 18.4 kPa with a range of 6.8 to 52.5 kPa. Two hundred seventy-one patients had no EVs (57.9%), 139 patients had F1 EVs (29.7%), and 58 patients had high-risk EVs (12.4%). The optimal cutoff values of SWE for predicting EVs and high-risk varices were 18.5 and 20.4 kPa, respectively. The AUROCs for predicting the incidence of EVs were 0.792 (95% confidence interval [CI], 0.884-0.842), 0.814 (95% CI, 0.658-0.875), and 0.895 (95% CI, 0.813-0.918) for platelet, platelet count-to-spleen diameter ratio, and liver stiffness, respectively. For predicting the presence of high-risk varices, liver stiffness again had the highest AUROC. Multivariate analysis identified liver stiffness and platelet count-to-spleen diameter ratio as independent predictive factors for EVs in cirrhosis. Liver stiffness measured by SWE is an effective diagnostic tool for predicting EVs with greater accuracy, and SWE value is an independent factor for predicting high-risk EVs.