Electromagnetic navigation bronchoscopy (ENB) can help to accurately locate pulmonary nodules using a minimally invasive approach. This study sought to evaluate the clinical efficacy and safety of dye marking localization under the guidance of ENB followed by surgery. A retrospective analysis was performed of 61 patients who underwent ENB localization using methylene blue dye marking before surgery at Shanghai General Hospital from October 2021 to February 2022. The clinical efficacy and safety of ENB localization and the related factors affecting the navigation time of ENB location were analyzed. ENB was performed on 170 pulmonary nodules in 61 patients with a median age of 60 [interquartile range (IQR), 18] years. The majority of patients (70.69%) had more than two pulmonary nodules. The median maximum nodule diameter was 10 (IQR, 8) mm, and 48.21% of the nodules were mixed ground-glass nodules. Median time for ENB navigation was 10.5 (IQR, 6) min. The navigation success rate was 92.96%, and the ENB location success rate was 95.89%. The rate of complications related to ENB localization was 1.64% (there was only one case of pulmonary hemorrhage). The multivariate analysis showed that the factors related to the navigation time included the node location (P=0.001) and location mode (P=0.04). ENB-guided methylene blue injection is an effective and safe tool for localizing and marking pulmonary nodules, and can be used to assist the diagnosis and treatment of early lung cancer. The node location and location mode had significant effects on navigation time.