In this study, we propose a refractive index sensor for the simultaneous detection of cancer and diabetes based on photonic crystals (PhC). The proposed PhC composed of silicon rods in the air bed arranged in a hexagonal lattice forms the fundamental structure, and two tubes are used to place the cancerous or diabetic samples for measurement. The sensor's transmission characteristics are simulated and analyzed by solving Maxwell's electromagnetic equations using the finite-difference time-domain method for samples under study. The diagnosis of three types of cancer and diabetes is based on changing the samples' refractive index by applying the laser source centered at 1550 nm. Our results demonstrate that the proposed structure's quality factor and sensitivity can be adjusted by changing the sensor's geometry. They reveal that the transmission power is between 91% ~ 100%, depending on the sample. The sensitivity range is also between 1294 and 3080 nm/RIU. The maximum figure of merit is about 1550.11 RIU− 1 with a detection range of 31×10− 6 RIU. The small biosensor area of 61.56 µm2 makes it a suitable device for various applications in compact photonic integrated circuits.