A 3 step process for obtaining a biofuel consisting mainly of methyl pyran or methyl tetrahydro pyran, by successively solving cellulose in N-alkyl imidazol chloride containing excess of hydrochloric acid 37%, hydrolysing cellulose into glucose, dehydrating glucose to isomers of hydroxymethyl pyranone, adding to the reaction mixture an water solution containing 10% sodium chloride, extracting with n-butanol, concentrating the butanol extract by distillation, extracting from the butanol phase residues of N-alkyl imidazol chloride, using again a water solution containing 10% sodium chloride, hydrogenating the almost chloride free butanol concentrate and isolating the biofuel by distilling out the butanol.