CO2 degassing of mafic silicate melts is an important part of the terrestrial carbon cycle, at mid-ocean ridges, oceanic hot spots, or in the middle of continents. Deeper CO2-bearing mafic magmas may also exist, such as those suspected in the D″ zone, and certainly existed in the magma ocean of the early Earth. Knowledge of the CO2 solubility in mafic melts at high pressure is therefore important but unknown at present. Results from molecular dynamics simulation (e.g., Guillot and Sator, 2011) predict that CO2 solubility in basalt may be much higher than previously thought at pressures and temperatures relevant to the upper mantle. But some recent models predict low solubility at high pressure (e.g., Eguchi and Dasgupta, 2018). The present study thus experimentally investigates the solubility of CO2 in basalt and andesite in the pressure range 1.5–8.5 GPa at 1820–2130 K in oxidizing conditions. Up to 4 GPa, the quenched samples are essentially vitreous and CO2-saturated. Their CO2 contents are measured using confocal micro-Raman spectroscopy, where we establish an internal calibration line relating CO2 content to the area of the Raman band assigned to the ν1 stretching vibration of carbonate groups. This calibration appears independent from the spectrometer, sample or experimentalist, thus enhancing confidence in this method. At 5 and 8.5 GPa, some of the quenched samples are found partially crystallized. Their CO2 abundance is estimated at micro-scale from Raman mapping, and at large scale from image analysis and presence/absence of vesicles. Over the 1.5–8.5 GPa pressure range, obtained CO2 concentrations vary between 1.8 and > 13.6 wt%. At 5 GPa and 1873 K, the CO2 content in basalt and andesite are similar. These findings experimentally confirm the ability of mafic melts to accommodate large amounts of CO2 at conditions prevailing in the deep Earth. A consequence is that magmas issued from partial melting of carbonate-bearing silicate rocks may ascend with significant quantities of CO2 of several wt% and more: when reaching shallower depths, they may degas large quantities of CO2. Present estimates of the global carbon flux to the atmosphere may thus be underestimated, and implications to early magma ocean degassing may be considered. Other consequences may concern the genesis of kimberlites and carbonatites. We finally speculate that, if silicate melts exist in the D″ zone, significant amounts of carbon may be stored there, and consequences may arise as to carbon sequestration in the core.