Upgrading raw biogas to methane (CH4) is a vital prerequisite for the utilization of biogas as a vehicle fuel or the similar field as well. In this work, biogas yield from the anaerobic fermentation of food waste containing methane (CH4, 60.4%), carbon dioxide (CO2, 29.1%), hydrogen sulfide (H2S, 1.5%), nitrogen (N-2, 7.35%) and oxygen (O-2, 1.6%) was upgraded by dynamic adsorption. The hydrogen sulfide was removed from the biogas in advance by iron oxide (Fe2O3) because of its corrosion of the equipment. Commercial 13X zeolite and carbon molecular sieve (CMS) were used to remove the other impurity gases from wet or dry biogas. It was found that neither 13X zeolite nor CMS could effectively remove each of the impurities in the wet biogas for the effect of water vapor. However, 13X zeolite could effectively remove CO(2)after the biogas was dried with silica and showed a CO(2)adsorption capacity of 78 mg/g at the condition of 0.2 MPa and 25 degrees C. Additionally, 13X zeolite almost did not adsorb nitrogen (N-2), so the CH(4)was merely boosted to ac. 91% after the desulfurated dry biogas passed through 13X zeolite, nitrogen remaining in the biogas. CMS would exhibit superior N(2)adsorption capacity and low CO(2)adsorption capacity if some N(2)was present in biogas, so CMS was able to remove all the nitrogen and fractional carbon dioxide from the desulfurated dry biogas in a period of time. Finally, when the desulfurated dry biogas passed through CMS and 13X zeolite in turn, the N(2)and CO(2)were sequentially removed, and then followed the high purity CH4(>= 96%).