Olefin/paraffin separation is an important but challenging and energy-intensive process in petrochemical industry. The realization of carbons with size-exclusion capability is highly desirable but rarely reported. Herein, we report polydopamine-derived carbons (PDA-Cx, where x refers to the pyrolysis temperature) with tailorable sub-5 Å micropore orifices together with larger microvoids by one-step pyrolysis. The sub-5 Å micropore orifices centered at 4.1–4.3 Å in PDA-C800 and 3.7–4.0 Å in PDA-C900 allow the entry of olefins while entirely excluding their paraffin counterparts, performing a precise cut-off to discriminate olefin/paraffin with sub-angstrom discrepancy. The larger voids enable high C2H4 and C3H6 capacities of 2.25 and 1.98 mmol g−1 under ambient conditions, respectively. Breakthrough experiments confirm that a one-step adsorption-desorption process can obtain high-purity olefins. Inelastic neutron scattering further reveals the host–guest interaction of adsorbed C2H4 and C3H6 molecules in PDA-Cx. This study opens an avenue to exploit the sub-5 Å micropores in carbon and their desirable size-exclusion effect.