One of the global challenges, nowadays, is detecting and removing the waterborne bacteria from drinking water. In this work, we propose a one dimensional photonic crystal based on Si/SiO2 layers containing a defect layer in the middle of the structure to detect waterborne bacteria. The findings have been formulated using transfer matrix method where the sensor mechanism is based on the variation of refractive index of different bacteria samples from that of pure water. The impact of various parameters like the angle of incidence, thickness of defect layer and the number of periods of the structure are studied to find the optimized condition. The sensor shows high sensitivity of 2475.72 nm/RIU that can detect very small changes of defect mode peak inside the photonic bandgap of the transmission spectra. Other performance parameters such as the quality factor (4951.7125), figure of merit (5688.50333 RIU-1) and limit of detection (3×10-05) have also been calculated to get a deeper understanding of the sensor’s capabilities. Therefore, the simplicity and great performance makes our design efficient for any sensing application as well as fabrication process.