Forecasting CO2 emissions is essential for understanding and reducing the effects of climate change, directing the formulation of public policy, and carrying out successful environmental initiatives. Reliable forecasts can assist countries such as Denmark in more effectively reducing their carbon footprint and complying with global climate accords. In this work, we investigate how well different machine learning methods estimate Denmark’s CO2 emissions. Eight distinct methods were used: an ensemble model, Lasso Regression, Decision Tree, Random Forest, SVM with linear kernel, SVM with polynomial kernel, and SVM with radial basis kernel. With a R2 score of 99% and a Root Mean Squared Error (RMSE) of 0.01199, the ensemble model outperformed the others. Weighted averaging was used in the construction of the ensemble model, utilizing the complementary strengths of the underlying models to increase forecast accuracy. When compared to traditional and individual machine learning models, the ensemble model’s improved performance highlights its promise as a dependable tool for CO2 emission forecasting, offering more accurate and steady predictions. The results of this study are especially helpful for environmental analysts and politicians in Denmark since they provide a solid technique for estimating CO2 emissions and support the creation of data-driven plans to lessen the effects of climate change.