A series of hierarchically porous ZIF-8 materials or films or structures or suspensions or nanoparticles (SPECIFY WHAT DID YOU MAKE) were synthesized with sodium dodecylsulphate (SDS) as the template of mesopores and macropores. These samples werecharacterized by XRD, N2 adsorption-desorption, SEM, TEM and TGA, and assessedby selective CO2 adsorption. The as-synthesized ZIF-8 was lamellar with mesopores and macropores penetrating the layers, and the meso-macroporous porosity could be finely tuned by changing the SDS concentration. Compared with conventional microporous ZIF-8, the present hierarchically porous ZIF-8 had larger CO2 adsorption capacity and higher CO2/N2 adsorption selectivity because its mesopores and macropores promote efficient CO2 diffusion and increase the accessible CO2 adsorption sites. Moreover, the as-synthesized hierarchically ZIF-8 showed good thermal stability, as high as 753K, indicating promising industrial applications. The method proposed here opens a new route to synthesizing micro-meso-macroporous ZIF-8 with tunable porosity.