As an alternative technology to energy intensive distillations, adsorptive separation by porous solids offers lower energy cost and higher efficiency. Herein we report a topology-directed design and synthesis of a series of Zr-based metal-organic frameworks with optimized pore structure for efficient separation of C6 alkane isomers, a critical step in the petroleum refining process to produce gasoline with high octane rating. Zr6O4(OH)4(bptc)3 adsorbs a large amount of n-hexane but excluding branched isomers. The n-hexane uptake is ~70% higher than that of a benchmark adsorbent, zeolite-5A. A derivative structure, Zr6O4(OH)8(H2O)4(abtc)2, is capable of discriminating all three C6 isomers and yielding a high separation factor for 3-methylpentane over 2,3-dimethylbutane. This property is critical for producing gasoline with further improved quality. Multicomponent breakthrough experiments provide a quantitative measure of the capability of these materials for separation of C6 alkane isomers. A detailed structural analysis reveals the unique topology, connectivity and relationship of these compounds.