Simultaneous capture of formaldehyde (HCHO) and carbon dioxide (CO2) in indoor air is promising of achieving indoor-air purification. Of all potential adsorbents, hexagonal boron nitride (h-BN) is one of the most suitable species owing to facile formation of attraction points. Therefore, in this study, performances of HCHO and CO2 being adsorbed over pure/modified h-BN are systematically investigated via density functional theory (DFT) calculations. Minutely speaking, direct interaction between HCHO and CO2, single-point adsorption enhancement of HCHO over modified h-BN, co-adsorption reinforcement of HCHO/CO2 as well as relevant thermodynamic characteristics are major research contents. According to calculation results, there is relatively strong attraction between HCHO and CO2 owing to hydrogen bonds, which is in favor of co-adsorption of HCHO/CO2. As to single-adsorption of HCHO, C-doped h-BN shows better adsorption features than P-doped h-BN and C/P-doped h-BN is slightly weakened in adsorption ability due to surficial deformation caused by P atoms. For co-adsorption of HCHO/CO2, CO2 is the protagonist via formation of quasi-carbonate with the help of delocalized π-orbital electrons. Regarding effects of temperatures on adsorption strengths, they depend on interelectronic interactions among dopant atoms and finally derives from dispersion of π bonds across adsorbents. Overall, this study provides detailed mechanisms for co-capture of HCHO/CO2 to accomplish indoor-air purification.