In this investigation, we present a tailored one-dimensional photonic crystal sensor (1D PCS), magnesium oxide (MgO) and silicon dioxide (SiO2) layers designed for the specific detection of diseased blood samples components, including plasma, platelets, red blood cells, and uric acid concentrations. The sensor structure is architecturally optimized for 6, 8,10,12,14, and 20 periods, encapsulating a central defect cavity that facilitates the interaction with the blood samples. Upon introducing the blood samples into this cavity, the transmittance spectrum is meticulously analyzed using the transfer matrix method to observe the variations in the defect mode’s wavelength. The study is conducted over a range of incident waves from wavelength 450 to 750 μm, enhancing the understanding of the sensor’s effect on the detection mechanism. In this context, our sensor demonstrates a remarkable sensitivity of approximately 815 nm per refractive index unit (RIU-1). It achieves a detection limit of 10–5, showcasing an exceptional ability to detect low concentrations of the infected blood components.Moreover, Q Factor of 3795 and FOM of 3369.18 indicate the sensor’s high precision in differentiating between healthy and infected blood samples.These findings underscore the potential of the proposed MgO-SiO2-based 1D PhC sensor in serving as a high-fidelity tool for biosensing application.