This study aimed to evaluate the diagnostic value of ultrasound for community-acquired pneumonia (CAP) in children. Clinical information of children diagnosed with CAP and a control group of healthy children was collected, and lung ultrasound detection was performed. The lung ultrasound score (LUS) was assessed, and venous blood samples were collected. Serum indexes, including white blood cell count, were analyzed using an automatic immunoassay analyzer, while serum procalcitonin (PCT) level was measured using an enzyme-linked immunosorbent assay. The pediatric critical illness score (PCIS) was also performed for all subjects. White blood cell count, absolute neutrophil count, and respiratory index were significantly higher in the CAP group than those in the control group, while the oxygenation index was markedly lower. Ultrasound detection results showed that the CAP group exhibited significantly higher detection rates of pleural effusion, interstitial lung changes, lung consolidation, B-lines, air bronchogram signs, and reduced or absent lung sliding signs compared with the control group. In addition, the LUS and PCT levels were markedly higher in the CAP group, while the PCIS was notably lower. Further analysis exhibited that the LUS in the CAP group was significantly positively correlated with PCT levels and negatively correlated with PCIS. The receiver operating characteristic curve indicated that the area under the curve of LUS for diagnosing children with lung infection was 0.841. LUS is closely related to serum PCT level and PCIS. Lung ultrasound detection demonstrates high sensitivity and specificity, indicating its valuable clinical diagnostic utility for CAP in children.