Biogas and biohydrogen, due to their renewable nature and zero carbon footprint, are considered two of the gaseous biofuels that will replace conventional fossil fuels. Biogas from anaerobic digestion must be purified and converted into high-quality biomethane prior to use as a vehicle fuel or injection into natural gas networks. Likewise, the enrichment of biohydrogen from dark fermentation requires the removal of CO2, which is the main pollutant of this new gaseous biofuel. Currently, the removal of CO2 from both biogas and biohydrogen is carried out by means of physical/chemical technologies, which exhibit high operating costs and corrosion problems. Biological technologies for CO2 removal from biogas, such as photosynthetic enrichment and hydrogenotrophic enrichment, are still in an experimental development phase. In this context, membrane separation has emerged as the only physical/chemical technology with the potential to improve the performance of CO2 separation from both biogas and biohydrogen, and to reduce investment and operating costs, as a result of the recent advances in the field of nanotechnology and materials science. This review will focus on the fundamentals, potential and limitations of CO2 and H2 membrane separation technologies. The latest advances on membrane materials for biogas and biohydrogen purification will be systematically reviewed.