The design of materials and their manufacture into membranes that can handle industrial conditions and separate complex non aqueous mixtures are challenging. We report a versatile strategy to fabricate polytriazole membranes with 10-nanometer-thin selective layers containing sub nanometer channels for the separation of hydrocarbons. The process involves the use of the classical nonsolvent-induced phase separation method and thermal cross-linking. The membrane selectivity can be tuned to the lower end of the typical nanofiltration range (200 to 1000 gram mole−1). The polytriazole membrane can enrich up to 80 to 95% of the hydrocarbon content with less than 10 carbon atoms (140 gram mole−1).These membranes preferentially separate paraffin over aromatic components, making them suitable for integration in hybrid distillation systems for crude oil fractionation