Hydrogen is a vital and clean energy source, and it is of great significance to achieve efficient separation and purification of hydrogen. In this study, highly selective hydrogen separation was achieved by thermal cross-linking of amidoxime-functionalized polymers of intrinsic microporosity (AOPIM-1) membranes under an argon atmosphere, where a two-step self-cross-linking reaction occurred among the amidoxime groups on the polymer chains by forming oxadiazole rings and triazine rings. The cross-linking reaction was systematically verified by 13 C solid-state nuclear magnetic resonance, attenuated total reflection infrared spectroscopy, and X-ray photoelectron spectrometry. Thanks to the controllable cross-linking reaction, not only are the gas transport channels finely tailored, but also the backbone structure is effectively retained. The resulting membranes exhibited remarkable molecular sieving behavior. The selectivities of H 2 /CO 2 , H 2 /N 2 , and H 2 /CH 4 gas pairs are 16, 500, and 1000, respectively, and the permeabilities of H 2 , CO 2 , N 2 , and CH 4 are 300, 18.6, 0.6, and 0.3 Barrer, respectively, far exceeding the state-of-the-art reported upper bound. The thermally cross-linked AOPIM-1 membrane shows potential application in hydrogen separation.