Admittedly, finding reliable figures on this is difficult. But we assume that, according to statistics, an average of 20,000 tons of black powder with a CO2 equivalent of 4600 tons were sold in Germany last year. This corresponds to a CO2 equivalent of 0.23 tons per ton of black powder.
In Germany, category F2 rockets are usually sold. These have a net explosive mass of 20 grams. This means that the CO2 equivalent of a rocket is 4.6 g CO2e per rocket. This is equivalent to driving a mid-range car 29 meters.
But fireworks can also be done digitally, e.g. with the currently free software FWSim. Assume a rocket explodes digitally for 10 seconds on a 50 inch TV. This has a power consumption of 71 watts; thus 71 Wh. With a CO2 equivalent for the electricity mix Germany with 0.55 g CO2 per Wh, the TV has a CO2e of 39.05 g per hour and 0.011 g CO2e per second. With an explosion duration of the digital rocket, this is then 0.11 g CO2e per rocket. By the way, if you power your TV set with electricity from renewable sources, you have a CO2e of 0.007 g CO2e per rocket.
And is a digital firework more sustainable than a real one? Probably yes, it protects the environment, flora and fauna and it is cheaper. Whether a digital firework is as much fun, everyone has to decide for himself.
Happy new year!
Note: This is not a scientific study, but only an assumption. The numerical values can deviate from reality. Therefore, no liability is assumed for the calculation and the given numerical values.