Biofuels derived from vegetable oils are increasingly used in diesel engines. The article analyzes the physicochemical properties of petroleum diesel fuel and biofuels of various compositions. A technique has been developed to optimize the composition of multicomponent composite biofuels for diesel engines of agricultural machinery. The optimal composition of a mixture of petroleum diesel fuel, rapeseed oil and rapeseed oil methyl ester has been determined, providing the best combination of fuel efficiency and exhaust emissions. The optimization calculations made it possible to select the composition of a multicomponent mixed biofuel for the D-245.12S engine installed on domestic agricultural machines. © Published under licence by IOP Publishing Ltd.