The Danish government has set a target of being fossil fuel independent by 2050 implying that a high degree of inflexible renewable energy will be included in the energy system; biogas can add flexibility and potentially has a negative CO 2 -emission. In this paper, we investigate the socioeconomic system costs of reaching a Danish biogas target of 3.8 PJ in the energy system, and how CO 2 -costs affect the system costs and biogas usage.We perform our analysis using the energy systems model, Balmorel, and expand the model with a common target for raw biogas and upgraded biogas (biomethane). Raw biogas can be used directly in heat and power production, while biomethane has the same properties as natural gas.Balmorel is altered such that natural gas and biomethane can be used in the same technologies.Several CO 2 -cost estimates are investigated; hereunder a high estimate for the expected CO 2 -externality costs. We find that system costs increase with CO 2 -costs in most cases, while the biogas target becomes socio-economically cheaper. In the case of a very high CO 2 -cost, system costs decrease and biomethane becomes the primary fuel. Furthermore, biomethane functions as regulating power and the Danish fuel consumption increases due to a higher electricity export.