# Energy in Spain

Primary energy consumption in Spain in 2020 was mainly composed of fossil sources. The largest sources are petroleum (42.3%), natural gas (19.8%) and coal (11.6%). The remaining 26.3% is accounted for by nuclear energy (12%) and different renewable energy sources (14.3%). Domestic production of primary energy includes nuclear (44.8%), solar, wind and geothermal (22.4%), biomass and waste (21.1%), hydropower (7.2%) and fossil (4.5%).

## Energy statistics

Production capacities for electricity (billion kWh) :
| Type | Amount |
| Fossil fuel | 328.77 |
| Wind power | 224.26 |
| Nuclear | 222.23 |
| Hydro | 132.93 |
| Solar | 82.19 |
| Biomass | 26.38 |
| Total | 1,016.76 |
Electricity (billion kWh) :
| Category | Amount |
| Consumption | 233.27 |
| Production | 253.99 |
| Import | 17.93 |
| Export | 14.65 |
Natural Gas (billion m$^3$) :
| Consumption | 32.03 |
| Production | 0.01 |
| Import | 32.49 |
| Export | 1.19 |
Crude Oil (barrels per day) :
| Consumption | 1,330,000 |
| Production | 47,200 |
| Import | 1,360,000 |

## Energy plan

By 2030 the government plan is to have 62 GW of wind power installed, 76 GW of photovoltaic power, 4.8 GW of solar thermal power, 1.4 GW of biomass power, and 22 GW of storage. This should give a 32% decrease in greenhouse gasses compared to 1990. The long term plan is to achieve carbon neutrality before 2050.

## Energy sources
### Fossil fuels
#### Coal

In December 2021 Spain had a capacity of 4.1 GW using coal as the energy source, in 2022 consumption was 6.5Mt, although the plan is to phase coal out by 2030.
Coal production 2011-2021 (Exajoules)$^{:38}$ :
| 2011 | 2012 | 2013 | 2014 | 2015 | 2016 | 2017 | 2018 | 2019 | 2020 | 2021 |
| 0.11 | 0.10 | 0.07 | 0.07 | 0.05 | 0.03 | 0.05 | 0.04 | <0.005 | <0.005 | <0.005 |

#### Natural gas

Algeria is Spain's largest natural gas supplier. Amid the deterioration of relations with Morocco, Algeria decided not to renew the contract of the Maghreb–Europe Gas Pipeline (GME), which expired at midnight on 31 October 2021. From November 1 on, natural gas exports to Spain are primarily transported through the Medgaz pipeline (with the short-term possibility of covering further demand either by expanding the Medgaz or by shipping LNG).
Natural gas consumption 2011-2021 (billion cubic metres)$^{:31}$ :
| 2011 | 2012 | 2013 | 2014 | 2015 | 2016 | 2017 | 2018 | 2019 | 2020 | 2021 |
| 33.6 | 33.2 | 30.3 | 27.5 | 28.5 | 29.1 | 31.7 | 31.5 | 36.0 | 32.5 | 33.9 |
The demand for natural gas in Spain in 2022 was 364.3 TWh. Gas used for power generation increased 52% from 2021, with household, commercial and industrial demand for gas falling 21% to 226.4 TWh.

### Renewable energy

Years in which the last three renewable power levels achieved :
| Year of Recording | Renewal Energy Percentage Achievement |
| 2009 | 10% |
| 2012 | 15% |
| 2020 | 20% |
Renewable energy includes wind, hydro and solar power, biomass and geothermal energy sources.
Spain has long been a leader in renewable energy, and has recently become the first country in the world to have relied on wind as its top energy source for an entire year. The country is attempting to use wind power to supply 40 percent of its electricity consumption by 2020. At the same time, Spain is also developing other renewable sources of energy, particularly solar photovoltaic.
Renewable based power in Spain reached 46.7% of total power consumption in 2021.

#### Solar power

In 2013, solar accounted for 3.1 percent of Spain's total electricity when capacity was 4,638 MW. By 2022 Spain had increased the solar capacity to 19,113 MW.

#### Wind power

In 2021, wind power provided 24% of Spain’s total installed power generation capacity and 23% of total power generation. In 2023 it will reach 30 GW of capacity.

#### Biomass

Biomass provides around 2% of electricity generation capacity.

### Nuclear energy

Spain has seven operating nuclear reactors and in 2022 they generated 20.25% of the country’s electricity.
The government’s energy and climate plan specifies that installed nuclear capacity will remain at current levels of about 7,100 MW until at least 2025, and will then reduce to just over 3,000 MW from 2030 onwards.

### Hydro energy

In Spain in 2021 hydro power provided 17% of Spain’s total installed power generation capacity and 11% of total power generation.
Hydropower capacity from 2014 to 2023 (MW)$^{:7}$ :
| 2014 | 2015 | 2016 | 2017 | 2018 | 2019 | 2020 | 2021 | 2022 | 2023 |
| 19,223 | 20,053 | 20,080 | 20,079 | 20,080 | 20,114 | 20,117 | 20,132 | 20,137 | 20,140 |
Drought impacts electricity production from hydro in the summer months.

## Global warming

According to Energy Information Administration the CO$_2$ emissions from energy consumption of Spain were in 2009 360 Mt, below Italy 450 Mt and France 429 Mt and above Poland 295 Mt and the Netherlands 250 Mt. The emissions tonnes per capita were in Spain 7.13, Italy 7.01 France 6.3 Poland 7.43, and the Netherlands 14.89.