The increasing depletion of fossil fuels and the environmental burden associated with waste vegetable oil require sustainable fuel-production routes that are efficient, low-cost and recyclable. This study optimised biodiesel production from waste vegetable oil using potassium hydroxide-impregnated diatomite as a heterogeneous catalyst. Raw diatomite was thermally treated at 500 °C for 4 h and chemically modified by KOH impregnation at KOH/diatomite ratios of 1:3–1:6. Catalyst modification was confirmed using FTIR, XRF and SEM, with XRF showing silica as the dominant phase in raw diatomite and FTIR identifying characteristic Si–O–Si bands near 1073 and 465 cm⁻¹. A central composite design within response surface methodology was applied to evaluate the effects of methanol-to-oil ratio, catalyst loading, reaction time and reaction temperature on biodiesel yield. The experimental biodiesel yields ranged from 74.82 to 95.06%, while catalyst screening showed a maximum yield of 93.2% at the 1:5 KOH/diatomite ratio. The quadratic model showed excellent agreement with the experimental data, with R² = 0.9929, adjusted R² = 0.9852, predicted R² = 0.9620, adequate precision = 36.96 and a low coefficient of variation of 0.878%. ANOVA confirmed that the model was highly significant, with an F-value of 129.19 and p < 0.0001. Reusability tests gave biodiesel yields of 87, 84, 81 and 75% over four successive cycles. These results demonstrate that modified diatomite is an effective and reusable catalyst support for high-yield biodiesel production from waste vegetable oil.