Porous materials are very promising for the development of cost- and energy-efficient separation processes, such as for the purification of ethylene from ethylene/ethane mixture—an important but currently challenging industrial process. Here we report a microporous hydrogen-bonded organic framework that takes up ethylene with very good selectivity over ethane through a gating mechanism. The material consists of tetracyano-bicarbazole building blocks held together through intermolecular CN···H–C hydrogen bonding interactions, and forms as a threefold-interpenetrated framework with pores of suitable size for the selective capture of ethylene. The hydrogen-bonded organic framework exhibits a gating mechanism in which the threshold pressure required for guest uptake varies with the temperature. Ethylene/ethane separation is validated by breakthrough experiments with high purity of ethylene (99.1%) at 333 K. Hydrogen-bonded organic frameworks are usually not robust, yet this material was stable under harsh conditions, including exposure to strong acidity, basicity and a variety of highly polar solvents. Porous materials are promising candidates for the cost- and energy-efficient separation of ethylene and ethane from gas mixtures: an important but challenging industrial process. Now, a hydrogen-bonded organic framework has been reported that is stable under harsh conditions and can take up ethylene at practical temperatures—with very high selectivity over ethane—through a gating mechanism.