To explore the association between liver stiffness and the Child-Pugh classification of liver function by shear wave elastography (SWE). A total of 116 patients with liver cirrhosis were divided into 3 groups according to the Child-Pugh classification prospectively. Conventional ultrasound imaging and SWE were performed for all patients. The associations of liver stiffness measured by SWE with ultrasound measurements, serum biochemical indicators, and the Child-Pugh classification were analyzed. Receiver operating characteristic curves were analyzed and compared to determine the ability of liver stiffness to diagnose cirrhosis. Liver stiffness measured by SWE increased with an increasing Child-Pugh classification, internal diameter of the hepatic portal and splenic veins, spleen thickness, spleen length, total bilirubin level, and prothrombin time, which were positively correlated with the Child-Pugh classification (all P < .05). The albumin level and liver stiffness showed higher areas under the curve in comparison with other parameters for evaluating the Child-Pugh classification. Albumin and cholinesterase levels were negatively correlated with the Child-Pugh classification (P < .05). All of these indicators were significantly different between each pair of groups (all P < .05), except for the internal diameter of the hepatic portal vein, prothrombin time, and total bilirubin, and cholinesterase levels between groups B and C (P > 0.05) and the thickness and length of spleen and internal diameter of the splenic vein between groups A and B (P > 0.05). There were no differences among the groups for alanine aminotransferase, aspartate aminotransferase, and globulin levels. Liver stiffness measured by SWE was correlated with the Child-Pugh classification, and it may be able to help evaluate liver function in patients with cirrhosis.