Polyhydroxybutyrate (PHB) is a biodegradable polymer accumulated as carbon and energy reserve granules by several bacteria and is ideal substitute for petroleum-based polymers. The present study aimed to isolate PHB producing bacteria and optimize medium components and growth conditions to enhance PHB yield. Potent PHB accumulating bacterial strain was isolated from oil spilled soil and identified as Bacillus endophyticus based on its 16S rRNA analysis. Sudan Black B staining method was used to detect PHB granules and affirmed by using Fourier Transform Infrared Spectroscopy. Differential scanning calorimetry analysis was conducted for thermal analysis of extracted PHB polymer. Bacillus endophyticus showed highest PHB accumulation utilizing glucose as the carbon and potassium nitrate as the nitrogen source which were further optimized along with physical parameters like pH and temperature using Box and Behnken method. The highest biomass (7.49 g/L) and PHB (3.67 g/L) were observed at pH 7, temp. 37ºC, glucose 25 g/L and potassium nitrate 0.1 g/L. Bacillus endophyticus was found to accumulate up to 49% PHB under optimized conditions. These results indicate the potential application of Bacillus endophyticus at the industrial level for PHB production.