Lung cancer continues to be the main cause of cancer-related mortality worldwide, mostly attributable to late-stage diagnosis and inadequate early detection techniques. This study introduces a deep learning based automated approach for the early detection of lung cancer using CT and X-ray data. The suggested approach utilizes convolutional neural networks (CNNs), namely DenseNet121, to categorize lung tissue into three classifications: malignant, benign, and normal. The dataset, obtained from Kaggle, underwent preprocessing with scaling, normalization, and augmentation methods to enhance model resilience. Multiple sophisticated architectures, such as DenseNet121, MobileNetV2, VGG16, Xception, and InceptionV3, were assessed, with DenseNet121 attaining the greatest classification accuracy of 98.18%. We built a web based application using Streamlit to facilitate practical implementation, allowing healthcare providers to submit lung scans and receive real-time diagnostic predictions. The experimental findings indicate the improved efficacy of DenseNet121 in detecting lung problems, which supports its prospective incorporation into clinical practice. This study emphasizes the collaboration between deep learning and accessible online technology to improve the speed and accuracy of lung cancer detection, with the objective of minimizing diagnostic delays in clinical practice.