Two types of metal-organic frameworks (MOFs) have been synthesized and evaluated in the separation of C2 and C3 olefins and paraffins. Whereas Co2(dhtp) (=Co-CPO-27 = Co-MOF-74) and Mg2(dhtp) show an adsorption selectivity for the olefins ethene and propene over the paraffins ethane and propane, the zeolitic imidazolate framework ZIF-8 behaves in the opposite way and preferentially adsorbs the alkane. Consequently, in breakthrough experiments, the olefins or paraffins, respectively, can be separated.