Waste cooking oil is a common byproduct in the culinary industry, often posing disposal challenges. This study explores its conversion into the valuable bioplastic material, medium-chain-length polyhydroxyalkanoate (mcl-PHA), through microbial biosynthesis in controlled bioreactor conditions. Twenty-four bacterial isolates were obtained from oil-contaminated soil and waste materials in Mahd Ad-Dahab, Saudi Arabia. The best PHA-producing isolates were identified via 16S rDNA analysis as Neobacillus niacini and Metabacillus niabensis, with the sequences deposited in GenBank (accession numbers: PP346270 and PP346271). This study evaluated the effects of various carbon and nitrogen sources, as well as environmental factors, such as pH, temperature, and shaking speed, on the PHA production titer. Neobacillus niacini favored waste cooking oil and yeast extract, achieving a PHA production titer of 1.13 g/L, while Metabacillus niabensis preferred waste olive oil and urea, with a PHA production titer of 0.85 g/L. Both strains exhibited optimal growth at a neutral pH of 7, under optimal shaking -flask conditions. The bioreactor performance showed improved PHA production under controlled pH conditions, with a final titer of 9.75 g/L for Neobacillus niacini and 4.78 g/L for Metabacillus niabensis. Fourier transform infrared (FT-IR) spectroscopy and gas chromatography-mass spectrometry (GC-MS) confirmed the biosynthesized polymer as mcl-PHA. This research not only offers a sustainable method for transforming waste into valuable materials, but also provides insights into the optimal conditions for microbial PHA production, advancing environmental science and materials engineering.