Low‐dose computed tomography screening can increase the detection for non‐small‐cell lung cancer (NSCLC). To improve the diagnostic accuracy of early‐stage NSCLC detection, ultrasensitive methods are used to detect cell‐free DNA (cfDNA) 5‐hydroxymethylcytosine (5hmC) in plasma. Genome‐wide 5hmC is profiled in 1990 cfDNA samples collected from patients with non‐small cell lung cancer (NSCLC, n = 727), healthy controls (HEA, n = 1,092), as well as patients with small cell lung cancer (SCLC, n = 41), followed by sample randomization, differential analysis, feature selection, and modeling using a machine learning approach. Differentially modified features reflecting tissue origin. A weighted diagnostic model comprised of 105 features is developed to compute a detection score for each individual, which showed an area under the curve (AUC) range of 86.4%–93.1% in the internal and external validation sets for distinguishing lung cancer from HEA controls, significantly outperforming serum biomarkers (p < 0.001). The 5hmC‐based model detected high‐risk pulmonary nodules (AUC: 82%)and lung cancer of different subtypes with high accuracy as well. A highly sensitive and specific blood‐based test is developed for detecting lung cancer. The 5hmC biomarkers in cfDNA offer a promising blood‐based test for lung cancer.