Pneumonia detection and recognition have been one of the major challenges, and the machine learning community has been trying to tackle. Pneumonia is identified in X-ray images by the virtue of haziness in the lung region created due to the air sacs filled with fluid or pus. As pneumonia affects around 7% of the world’s population and kills over 700,000 children annually, the research in this field has become more prominent. In severe cases of COVID-19, people also get pneumonia. Earlier attempts using CNN, ChexNet, ensembles of transfer learning models have been carried out to solve this problem. However, work in this field has not been keeping up with the advancements in neural network happened in past few years. In this work, a 15-layer CNN architecture called CXR-15 is proposed. The performance of the architecture was tested on a dataset with 5856 images and compared with various existing architectures. CXR-15 outperformed most of the existing architectures used for pneumonia detection like ChexNet, Xception, InceptionResNetV2, VGG16, EfficientNet-B5, CNN as feature extractors and MobileNetV2 by achieving an accuracy of 95.2%. © 2022, The Author(s), under exclusive license to Springer Nature Singapore Pte Ltd.