Many room temperature ionic liquids (ILs) are nonvolatile solvents which have huge potential applications in various chemical processes. However, the synthesis of ILs usually uses different kinds of volatile organic solvents in the reaction and subsequent separation process. In this work, supercritical (sc) CO2, an environmentally benign solvent, has been utilized as the medium to synthesize ILs, 1-butyl-3-methylimidazolium bromide ([bmim]Br) and 1,3-dimethylimidazolium trifluoromethanesulfonate ([Me2Im]TfO). The results show that ILs can be synthesized in scCO2 with 100% yield and the excess reactants added can be extracted in situ by scCO2 without any cross-contamination. The whole process is green and very effective.