A method of synthesizing an ionic liquid, includes reacting a 1,2,3-triazole including at least one of a 4-substituent or a 5-substituent with a hydroxide compound having the formula R.sup.+OH.sup.- in a dehydration reaction, wherein R.sup.+ is an ionic liquid cation. R.sup.+ is a five-membered heterocyclic cation, an aromatic cation, a sulfonium cation, an ammonium cation, or a phosphonium cation. In a number of embodiments, R.sup.+ is a pyridinium cation, a bipyridinium cation, an amino pyridinium cation, a pyridazinium cation, an ozaxolium cation, a pyrazolium cation, an imidazolium cation, a pyramidinium cation, a triazolium cation, a thiazolium cation, an acridinium cation, a quinolinium cation, an isoquinolinium cation, an orange-acridinium cation, a benzotriazolium cation, a methimzolium cation, a sulfonium cation, an ammonium cation, or a phosphonium cation.
 This invention was made with government support under grant no. DE-FE0004000 awarded by the Department of Energy, National Energy Technology Laboratory. The government has certain rights in this invention.