This study consists of the development and optimisation of the potassium hydroxide-catalysed synthesis of fatty acid methyl esters (biodiesel) from sunflower oil. A factorial design of experiments and a central composite design have been used. The variables chosen were temperature, initial catalyst concentration by weight of sunflower oil and the methanol:vegetable oil molar ratio, while the responses were biodiesel purity and yield. The initial catalyst concentration is the most important factor, having a positive influence on biodiesel purity, but a negative one on biodiesel yield. Temperature has a significant positive effect on biodiesel purity and a significant negative influence on biodiesel yield. The methanol:vegetable oil molar ratio is only significant for the biodiesel purity, having a positive influence. Second-order models were obtained to predict biodiesel purity and yield as a function of these variables. The best conditions are 25 degrees C, a 1.3%wt for the catalyst concentration and a 6:1 methanol:sunflower oil molar ratio.