Film‐forming polymers containing ionic groups have attracted considerable attention as emerging materials for gas separation applications. The aim of this article was to synthesize new film‐forming polyimides containing imidazolium groups (PI‐IMs) and establish their structure–performance relationship. In this context, a new aromatic diamine, namely, N1‐(4‐aminophenyl)‐N1‐(4‐(2‐phenyl‐1H‐imidazol‐1‐yl)phenyl)benzene‐1,4‐diamine (ImTPADA), was synthesized and polycondensed with three aromatic dianhydrides, namely, 4,4′‐(hexafluoroisopropylidene)diphthalic anhydride, 4,4‐(4,4‐isopropylidenediphenoxy) bis(phthalic anhydride), and 4,4′‐oxydiphthalic anhydride to form the corresponding polyimides containing pendent 2‐phenylimidazole groups (PI‐IEs). Next, PI‐IMs were prepared by N‐quaternization of pendent 2‐phenylimidazole groups present in PI‐6FDA using methyl iodide followed by anion exchange with bis(trifluoromethane)sulfonimide lithium salt (LiTf2N). PI‐IEs and PI‐IMs exhibited reasonably high molecular weights, amorphous nature, good solubility, and could be cast into self‐standing films from their DMAc solutions. Thermogravimetric analysis showed that 10% weight loss temperature of PI‐IEs and PI‐IMs were in the range 545–475 °C and 303–306 °C, respectively. Gas permeability analysis of films of PI‐IEs and PI‐IMs was investigated by variable‐volume method and it was observed that incorporation of ionic groups into PI‐6FDA resulted in increased permeability while maintaining selectivity. In particular, polymer bearing Tf2N− anion exhibited high CO2 permeability (33.3 Barr) and high selectivity for CO2/CH4 (41.1) and CO2/N2 (35.4). © 2018 Wiley Periodicals, Inc. J. Polym. Sci., Part A: Polym. Chem. 2018, 56, 1721–1729