The combustion of syngas can be improved with the addition of biogas or hydrogen. The optimal content of hydrogen and biogas in the mixture with syngas is 20% and 30%, respectively. When these thresholds are exceeded, the indicated engine cycle work increases more slowly than the increase in NOx concentration. At an engine speed of 3000 rpm, with the same content of hydrogen and biogas, the advanced ignition angle of the syngas-hydrogen blend is about 4oCA smaller than that of the syngas-biogas blend. The optimal advanced ignition angle for syngas, biogas and hydrogen is 38oCA, 24oCA and 18oCA, respectively. With optimal mixture compositions and advanced ignition angle, the indicated engine cycle work is reduced by 35% and 32%, respectively, when converting fuel from hydrogen and biogas to syngas. To achieve the same increase in power, the biogas content in the syngas is 10% larger than the hydrogen content in the biogas. But to achieve the same level of NOx emission, the hydrogen content of the syngas is equal to 50% of the biogas content in the syngas.