Renewable energy consumption (% of total final energy consumption)

Source: worldbank.org, 01.09.2025

Year: 2021

Flag Country Value Value change, % Rank
Aruba Aruba 8.8 -3.3% 134
Afghanistan Afghanistan 20 +9.89% 98
Angola Angola 52.9 -12% 41
Albania Albania 41.9 -5.63% 53
Andorra Andorra 18.4 -12% 102
United Arab Emirates United Arab Emirates 1 +11.1% 165
Argentina Argentina 9.2 -6.12% 131
Armenia Armenia 9.1 +8.33% 132
American Samoa American Samoa 0.4 0% 169
Antigua & Barbuda Antigua & Barbuda 0.9 0% 166
Australia Australia 12.3 +9.82% 120
Austria Austria 36 +0.559% 62
Azerbaijan Azerbaijan 1.3 0% 163
Burundi Burundi 83.1 -0.36% 10
Belgium Belgium 11.7 -4.88% 124
Benin Benin 54.5 +18% 39
Burkina Faso Burkina Faso 71.2 -2.6% 25
Bangladesh Bangladesh 25 -8.09% 83
Bulgaria Bulgaria 20.4 -3.32% 96
Bahrain Bahrain 0 171
Bahamas Bahamas 1.1 -21.4% 164
Bosnia & Herzegovina Bosnia & Herzegovina 36.6 -2.92% 61
Belarus Belarus 8.2 -2.38% 137
Belize Belize 26.6 -15.3% 81
Bermuda Bermuda 0.9 0% 166
Bolivia Bolivia 12.8 -24.3% 118
Brazil Brazil 46.5 -7% 49
Barbados Barbados 5.5 +17% 144
Brunei Brunei 0 171
Bhutan Bhutan 81.8 -2.5% 13
Botswana Botswana 27.4 -1.08% 79
Central African Republic Central African Republic 90.9 0% 6
Canada Canada 23.8 -0.418% 86
Switzerland Switzerland 27.7 +4.92% 77
Chile Chile 24.2 -9.36% 85
China China 15.2 +2.01% 111
Côte d’Ivoire Côte d’Ivoire 58.2 -5.83% 36
Cameroon Cameroon 79.2 +0.38% 18
Congo - Kinshasa Congo - Kinshasa 96.3 +0.104% 1
Congo - Brazzaville Congo - Brazzaville 71.4 0% 24
Colombia Colombia 29.7 -7.19% 74
Comoros Comoros 41.2 -18.9% 55
Cape Verde Cape Verde 22.6 -3.42% 89
Costa Rica Costa Rica 34.2 -6.04% 65
Cuba Cuba 20.9 -14.7% 94
Curaçao Curaçao 2.8 0% 155
Cayman Islands Cayman Islands 0 171
Cyprus Cyprus 15.6 +4% 108
Czechia Czechia 17.2 +1.18% 106
Germany Germany 17.6 -4.86% 104
Djibouti Djibouti 26.6 -3.27% 81
Dominica Dominica 8.8 +2.33% 134
Denmark Denmark 39.5 0% 58
Dominican Republic Dominican Republic 14.8 -7.5% 112
Algeria Algeria 0.1 0% 170
Ecuador Ecuador 18.9 -6.44% 101
Egypt Egypt 6.1 -8.96% 142
Eritrea Eritrea 80.7 -0.247% 14
Spain Spain 19 -1.55% 100
Estonia Estonia 38 -5.94% 60
Ethiopia Ethiopia 90.6 -0.11% 7
Finland Finland 50.2 +6.13% 45
Fiji Fiji 29.7 -6.6% 74
France France 16.2 -3.57% 107
Faroe Islands Faroe Islands 5.1 -3.77% 146
Micronesia (Federated States of) Micronesia (Federated States of) 2.1 +5% 157
Gabon Gabon 91.3 0% 4
United Kingdom United Kingdom 12.2 -10.3% 121
Georgia Georgia 25.2 +7.69% 82
Ghana Ghana 39 -2.5% 59
Gibraltar Gibraltar 0 171
Guinea Guinea 66.8 +1.52% 29
Gambia Gambia 48.6 -2.41% 48
Guinea-Bissau Guinea-Bissau 87.4 +0.229% 8
Equatorial Guinea Equatorial Guinea 5.2 -20% 145
Greece Greece 21.5 +6.97% 92
Grenada Grenada 10.2 -0.971% 129
Greenland Greenland 11.6 -1.69% 125
Guatemala Guatemala 62.1 -5.19% 32
Guam Guam 4.5 -2.17% 148
Guyana Guyana 13.2 +10% 116
Hong Kong SAR China Hong Kong SAR China 0.4 +33.3% 169
Honduras Honduras 45.9 -8.57% 50
Croatia Croatia 34.1 +5.25% 66
Haiti Haiti 76.7 +0.524% 21
Hungary Hungary 15.3 +3.38% 110
Indonesia Indonesia 20.2 -7.76% 97
Isle of Man Isle of Man 3.2 +60% 152
India India 34.9 -3.32% 64
Ireland Ireland 12.7 -7.3% 119
Iran Iran 0.9 0% 166
Iraq Iraq 1.1 0% 164
Iceland Iceland 82.4 -0.603% 12
Israel Israel 6.2 +10.7% 141
Italy Italy 17.5 -6.42% 105
Jamaica Jamaica 10.5 -10.3% 128
Jordan Jordan 11.5 +7.48% 126
Japan Japan 8.8 +3.53% 134
Kazakhstan Kazakhstan 2 +11.1% 158
Kenya Kenya 67.7 -1.88% 28
Kyrgyzstan Kyrgyzstan 27.6 -8% 78
Cambodia Cambodia 52.4 +1.95% 42
Kiribati Kiribati 42.2 0% 52
St. Kitts & Nevis St. Kitts & Nevis 1.6 0% 161
South Korea South Korea 3.6 0% 150
Kuwait Kuwait 0.1 0% 170
Laos Laos 51.5 +1.78% 43
Lebanon Lebanon 6.8 +7.94% 140
Liberia Liberia 93.2 +0.215% 3
Libya Libya 3.1 -3.13% 153
St. Lucia St. Lucia 9.7 -3% 130
Liechtenstein Liechtenstein 53.6 -2.9% 40
Sri Lanka Sri Lanka 48.8 -1.01% 47
Lesotho Lesotho 33.6 -22.2% 68
Lithuania Lithuania 33.2 +4.73% 69
Luxembourg Luxembourg 20.5 -1.44% 95
Latvia Latvia 44 +0.457% 51
Macao SAR China Macao SAR China 13.6 +23.6% 115
Morocco Morocco 10.9 -1.8% 127
Moldova Moldova 21.4 -4.04% 93
Madagascar Madagascar 83.6 -1.3% 9
Maldives Maldives 1.4 -12.5% 162
Mexico Mexico 13 +5.69% 117
Marshall Islands Marshall Islands 12.1 +0.833% 122
North Macedonia North Macedonia 19.5 -2.5% 99
Mali Mali 71.2 -2.2% 25
Malta Malta 8.6 -6.52% 135
Myanmar (Burma) Myanmar (Burma) 62.9 +6.25% 31
Montenegro Montenegro 39.6 0% 57
Mongolia Mongolia 3 +3.45% 154
Northern Mariana Islands Northern Mariana Islands 0.5 +66.7% 168
Mozambique Mozambique 76.9 -4.11% 20
Mauritania Mauritania 22.1 +5.74% 90
Mauritius Mauritius 8.6 -8.51% 135
Malawi Malawi 71.1 -0.559% 26
Malaysia Malaysia 7.5 +7.14% 138
Namibia Namibia 30 -3.85% 73
New Caledonia New Caledonia 8.3 +36.1% 136
Niger Niger 79.6 -2.81% 16
Nigeria Nigeria 80.3 -1.83% 15
Nicaragua Nicaragua 50.4 -3.45% 44
Netherlands Netherlands 12.2 +14% 121
Norway Norway 61.4 +0.821% 33
Nepal Nepal 73.7 +0.821% 23
Nauru Nauru 1.6 +23.1% 161
New Zealand New Zealand 28.9 +0.697% 75
Oman Oman 0.1 0% 170
Pakistan Pakistan 41.6 -2.58% 54
Panama Panama 28 -1.75% 76
Peru Peru 30.6 -3.16% 72
Philippines Philippines 28 -3.78% 76
Palau Palau 0.9 0% 166
Papua New Guinea Papua New Guinea 54.5 +1.68% 39
Poland Poland 15.2 -5.59% 111
Puerto Rico Puerto Rico 2.6 +4% 156
North Korea North Korea 14.7 +31.3% 113
Portugal Portugal 32.3 +3.19% 71
Paraguay Paraguay 58.8 -4.39% 35
Palestinian Territories Palestinian Territories 15.4 +2.67% 109
French Polynesia French Polynesia 7.4 -9.76% 139
Qatar Qatar 0 171
Romania Romania 23.6 -2.07% 87
Russia Russia 3.5 -5.41% 151
Rwanda Rwanda 79.4 -2.82% 17
Saudi Arabia Saudi Arabia 0.1 0% 170
Sudan Sudan 61 -2.56% 34
Senegal Senegal 35.4 -8.53% 63
Singapore Singapore 1.1 +22.2% 164
Solomon Islands Solomon Islands 49.1 +0.204% 46
Sierra Leone Sierra Leone 71.1 -5.33% 26
El Salvador El Salvador 21.9 -7.59% 91
Somalia Somalia 95.4 -0.105% 2
Serbia Serbia 27.2 +4.62% 80
South Sudan South Sudan 32.4 -1.22% 70
São Tomé & Príncipe São Tomé & Príncipe 40.8 -1.92% 56
Suriname Suriname 14.5 -0.685% 114
Slovakia Slovakia 17.9 +1.7% 103
Slovenia Slovenia 23.4 +3.08% 88
Sweden Sweden 57.9 +0.173% 37
Eswatini Eswatini 65.4 +2.67% 30
Sint Maarten Sint Maarten 0 171
Seychelles Seychelles 1.7 +30.8% 160
Syria Syria 1.1 0% 164
Turks & Caicos Islands Turks & Caicos Islands 0.8 +60% 167
Chad Chad 69.9 -2.78% 27
Togo Togo 75.1 -1.44% 22
Thailand Thailand 19 -9.09% 100
Tajikistan Tajikistan 34.9 -10.1% 64
Turkmenistan Turkmenistan 0.1 0% 170
Timor-Leste Timor-Leste 12.1 +6.14% 122
Tonga Tonga 1.8 -5.26% 159
Trinidad & Tobago Trinidad & Tobago 0.5 0% 168
Tunisia Tunisia 11.6 -10.1% 125
Turkey Turkey 12 -12.4% 123
Tuvalu Tuvalu 5 0% 147
Tanzania Tanzania 78.3 -3.09% 19
Uganda Uganda 91 -0.655% 5
Ukraine Ukraine 8.9 +2.3% 133
Uruguay Uruguay 57.8 -5.56% 38
United States United States 10.9 -0.909% 127
Uzbekistan Uzbekistan 1 0% 165
St. Vincent & Grenadines St. Vincent & Grenadines 5 -3.85% 147
Venezuela Venezuela 33.7 +8.01% 67
British Virgin Islands British Virgin Islands 1.3 0% 163
U.S. Virgin Islands U.S. Virgin Islands 5.9 0% 143
Vietnam Vietnam 24.2 +28% 85
Vanuatu Vanuatu 24.6 -5.38% 84
Samoa Samoa 36 +1.12% 62
Yemen Yemen 3.7 +5.71% 149
South Africa South Africa 9.7 -1.02% 130
Zambia Zambia 83 -2.81% 11
Zimbabwe Zimbabwe 82.4 -2.02% 12

Renewable energy consumption as a percentage of total final energy consumption is a crucial indicator of how effectively a society is transitioning from fossil fuels towards more sustainable energy sources. This indicator encompasses a wide array of energy sources, including wind, solar, hydroelectric, biomass, and geothermal. The significance of this measure is underscored by the pressing global need to address climate change and to pursue development that is both sustainable and respectful of ecological systems.

The importance of renewable energy consumption cannot be overstated. As nations grapple with the realities of climate change and its effects, a shift towards renewable energy sources stands as a promising solution. Renewable energies are vital to reducing greenhouse gas emissions and fostering energy independence. In many developing nations, access to renewable energy can contribute greatly to local economies and improve the quality of life by providing consistent and sustainable energy sources. This shift is increasingly seen as a pathway to mitigate the factors exacerbating climate change, such as air pollution and habitat destruction.

An analysis of the latest data for 2022 demonstrates the heterogeneity in renewable energy consumption across different regions. The global median value for renewable energy consumption was 12.2%. While this figure may seem modest, it reflects significant progress in certain regions, particularly in those leading the charge towards renewable energy. The top five areas that showcase exceptional levels of renewable energy consumption are Somalia (95.4%), Liberia (92.8%), Central African Republic (90.9%), Uganda (90.9%), and Guinea-Bissau (87.4%). These countries exemplify how a heavy reliance on renewable resources can contribute to energy autonomy and decreased reliance on imported fossil fuels.

Conversely, the bottom five regions present a stark contrast, with some areas struggling to tap into renewable energy resources. The Cayman Islands, Sint Maarten, American Samoa, Northern Mariana Islands, and Turks & Caicos Islands each show alarmingly low percentages, with Cayman Islands and Sint Maarten reporting a complete absence of renewable consumption, at 0.0%. Such disparities highlight systemic challenges in these regions, which could include inadequate infrastructure, economic limitations, and lack of government policy favoring renewable investments.

Historically, the trajectory of global renewable energy consumption reflects a gentle but adamant upward trend since 1990, when the world registered a consumption of 16.66%. However, this figure saw fluctuations up until 2020 when it peaked at 19.77%. This upward arc poses a mixed narrative as the 1990 consumption levels initially suggested a high reliance on renewables, but subsequent years saw a decline, with a nadir around 2005 to 2010. It's evident that the transition has been uneven and often influenced by political, technological, and economic factors.

Factors affecting the renewable energy consumption indicator are multifaceted. Political decision-making and public policy play crucial roles. Government incentives, regulations, and targeted investments often encourage or discourage renewable energy development. Additionally, economic factors such as local availability of renewable resources, energy prices, and the financial capacity of consumers and industries heavily influence the transition to renewable energy. Technological advancements also dictate how efficiently renewable energy can be harnessed and integrated into existing energy grids, affecting consumption patterns significantly.

Various strategies have emerged to enhance renewable energy consumption. Countries are increasingly adopting ambitious renewable energy targets alongside investments in research and development. Promoting energy efficiency and conservation practices is also critical to complement renewable investments, allowing countries to maximize output from greener sources. Additionally, international cooperation and knowledge sharing can significantly boost the morale and capabilities of emerging economies looking to incorporate greener energy solutions.

However, the transition to renewable energy is not without its flaws. Many regions face challenges such as technology access and affordability, which can deter sustainable investments. The intermittency of some renewable sources, particularly solar and wind, requires robust energy storage solutions and diverse energy portfolios to ensure reliability. Moreover, regions with reliance on fossil fuel economies may encounter significant pushback from established interests, creating an antagonistic political landscape for renewable initiatives.

In conclusion, the renewable energy consumption percentage is a vital indicator reflecting the global shift towards more sustainable energy practices. While benchmark figures, such as the median of 12.2% in 2022, paint a mixed picture, they also highlight the significant progress made by various regions. As more countries strive for energy independence and sustainable economic growth, the future of renewable energy consumption looks promising, but it will require overcoming existing challenges through proactive policies, financial incentives, and technological innovation.

                    
# Install missing packages
import sys
import subprocess

def install(package):
subprocess.check_call([sys.executable, "-m", "pip", "install", package])

# Required packages
for package in ['wbdata', 'country_converter']:
try:
__import__(package)
except ImportError:
install(package)

# Import libraries
import wbdata
import country_converter as coco
from datetime import datetime

# Define World Bank indicator code
dataset_code = 'EG.FEC.RNEW.ZS'

# Download data from World Bank API
data = wbdata.get_dataframe({dataset_code: 'value'},
date=(datetime(1960, 1, 1), datetime.today()),
parse_dates=True,
keep_levels=True).reset_index()

# Extract year
data['year'] = data['date'].dt.year

# Convert country names to ISO codes using country_converter
cc = coco.CountryConverter()
data['iso2c'] = cc.convert(names=data['country'], to='ISO2', not_found=None)
data['iso3c'] = cc.convert(names=data['country'], to='ISO3', not_found=None)

# Filter out rows where ISO codes could not be matched — likely not real countries
data = data[data['iso2c'].notna() & data['iso3c'].notna()]

# Sort for calculation
data = data.sort_values(['iso3c', 'year'])

# Calculate YoY absolute and percent change
data['value_change'] = data.groupby('iso3c')['value'].diff()
data['value_change_percent'] = data.groupby('iso3c')['value'].pct_change() * 100

# Calculate ranks (higher GDP per capita = better rank)
data['rank'] = data.groupby('year')['value'].rank(ascending=False, method='dense')

# Calculate rank change from previous year
data['rank_change'] = data.groupby('iso3c')['rank'].diff()

# Select desired columns
final_df = data[['country', 'iso2c', 'iso3c', 'year', 'value',
'value_change', 'value_change_percent', 'rank', 'rank_change']].copy()

# Optional: Add labels as metadata (could be useful for export or UI)
column_labels = {
'country': 'Country name',
'iso2c': 'ISO 2-letter country code',
'iso3c': 'ISO 3-letter country code',
'year': 'Year',
'value': 'GDP per capita (current US$)',
'value_change': 'Year-over-Year change in value',
'value_change_percent': 'Year-over-Year percent change in value',
'rank': 'Country rank by GDP per capita (higher = richer)',
'rank_change': 'Change in rank from previous year'
}

# Display first few rows
print(final_df.head(10))

# Optional: Save to CSV
#final_df.to_csv("gdp_per_capita_cleaned.csv", index=False)
                    
                
                    
# Check and install required packages
required_packages <- c("WDI", "countrycode", "dplyr")

for (pkg in required_packages) {
  if (!requireNamespace(pkg, quietly = TRUE)) {
    install.packages(pkg)
  }
}

# Load the necessary libraries
library(WDI)
library(dplyr)
library(countrycode)

# Define the dataset code (World Bank indicator code)
dataset_code <- 'EG.FEC.RNEW.ZS'

# Download data using WDI package
dat <- WDI(indicator = dataset_code)

# Filter only countries using 'is_country' from countrycode
# This uses iso2c to identify whether the entry is a recognized country
dat <- dat %>%
  filter(countrycode(iso2c, origin = 'iso2c', destination = 'country.name', warn = FALSE) %in%
           countrycode::codelist$country.name.en)

# Ensure dataset is ordered by country and year
dat <- dat %>%
  arrange(iso3c, year)

# Rename the dataset_code column to "value" for easier manipulation
dat <- dat %>%
  rename(value = !!dataset_code)

# Calculate year-over-year (YoY) change and percentage change
dat <- dat %>%
  group_by(iso3c) %>%
  mutate(
    value_change = value - lag(value),                              # Absolute change from previous year
    value_change_percent = 100 * (value - lag(value)) / lag(value) # Percent change from previous year
  ) %>%
  ungroup()

# Calculate rank by year (higher value => higher rank)
dat <- dat %>%
  group_by(year) %>%
  mutate(rank = dense_rank(desc(value))) %>% # Rank countries by descending value
  ungroup()

# Calculate rank change (positive = moved up, negative = moved down)
dat <- dat %>%
  group_by(iso3c) %>%
  mutate(rank_change = rank - lag(rank)) %>% # Change in rank compared to previous year
  ungroup()

# Select and reorder final columns
final_data <- dat %>%
  select(
    country,
    iso2c,
    iso3c,
    year,
    value,
    value_change,
    value_change_percent,
    rank,
    rank_change
  )

# Add labels (variable descriptions)
attr(final_data$country, "label") <- "Country name"
attr(final_data$iso2c, "label") <- "ISO 2-letter country code"
attr(final_data$iso3c, "label") <- "ISO 3-letter country code"
attr(final_data$year, "label") <- "Year"
attr(final_data$value, "label") <- "GDP per capita (current US$)"
attr(final_data$value_change, "label") <- "Year-over-Year change in value"
attr(final_data$value_change_percent, "label") <- "Year-over-Year percent change in value"
attr(final_data$rank, "label") <- "Country rank by GDP per capita (higher = richer)"
attr(final_data$rank_change, "label") <- "Change in rank from previous year"

# Print the first few rows of the final dataset
print(head(final_data, 10))