In this work we evaluate the production of epichlorohydrin from glycerol, the main byproduct in the biodiesel industry. A process flowsheet is synthesized consisting of glycerol purification, reaction with HCl in hexanoic acid, and final reaction with NaOH to produce epichlorohydrin. Both reactions are complex equilibriums. The reaction medium, hexanoic acid, must be recovered. Finally, the products require purification. The process is selected based on the use of cheap and available secondary raw materials, namely HCl and NaOH, compared to other technical alternatives. We couple MATLAB with CHEMCAD to simulate the mass and energy balances. Finally, the economic analysis of the process shows that the process is profitable due to the high selling cost of the epichlorohydrin. For the production of 27 kt/yr of epichlorohydrin 99.9%, 41.5 kt/yr of glycerol, 29 t/y of HCl and 15.9 kt/yr of NaOH are need. The investment adds up to 63.7 M€ with a production cost of 1.28 €/kg.