Renewable electricity output (% of total electricity output)

Source: worldbank.org, 01.09.2025

Year: 2021

Flag Country Value Value change, % Rank
Aruba Aruba 14.8 0% 130
Afghanistan Afghanistan 78.2 -10.2% 29
Angola Angola 91.7 +8.06% 11
Andorra Andorra 93.3 -4.15% 8
United Arab Emirates United Arab Emirates 4.2 +11.1% 170
Argentina Argentina 25.5 -6.33% 94
Armenia Armenia 30 +28.2% 88
American Samoa American Samoa 3.87 +0.0397% 173
Antigua & Barbuda Antigua & Barbuda 5.66 +14.3% 159
Australia Australia 26.7 +18% 91
Austria Austria 79.9 -1.34% 26
Azerbaijan Azerbaijan 5.8 +6.02% 157
Burundi Burundi 61.3 -12.8% 51
Belgium Belgium 23.5 -14.1% 101
Benin Benin 0.258 -52.9% 195
Burkina Faso Burkina Faso 14 +3.88% 133
Bangladesh Bangladesh 1.5 +2.31% 185
Bulgaria Bulgaria 22.2 +13.5% 106
Bahrain Bahrain 0.0378 +12.7% 199
Bahamas Bahamas 0.481 +52.8% 190
Bosnia & Herzegovina Bosnia & Herzegovina 39.3 +33.2% 75
Belarus Belarus 3.15 -9.95% 175
Belize Belize 92.9 -1.51% 9
Bolivia Bolivia 38.3 +6.53% 76
Brazil Brazil 77.4 -6.97% 31
Barbados Barbados 7.33 +34.5% 145
Brunei Brunei 0.0197 +1.54% 201
Bhutan Bhutan 100 0% 1
Botswana Botswana 0.254 -6.72% 196
Central African Republic Central African Republic 96.5 0% 5
Canada Canada 67.3 +0.265% 41
Switzerland Switzerland 68.1 +6.58% 39
Chile Chile 48.1 -1.44% 63
China China 28.4 +1.12% 89
Côte d’Ivoire Côte d’Ivoire 22.8 -24.2% 103
Cameroon Cameroon 53.9 -8.79% 59
Congo - Kinshasa Congo - Kinshasa 90.4 -5.14% 13
Congo - Brazzaville Congo - Brazzaville 26.3 -6.41% 92
Colombia Colombia 72.7 +11.4% 35
Comoros Comoros 0 203
Cape Verde Cape Verde 18.3 +8.61% 121
Costa Rica Costa Rica 99.4 +0.429% 3
Cuba Cuba 5.19 +6.6% 160
Curaçao Curaçao 18.3 -26.1% 122
Cayman Islands Cayman Islands 2.94 +9.24% 176
Cyprus Cyprus 15.1 +23% 128
Czechia Czechia 14 -2.19% 132
Germany Germany 39.8 -11.2% 73
Djibouti Djibouti 35.4 +7,301% 81
Dominica Dominica 20.3 -0.477% 111
Denmark Denmark 79 -3.26% 28
Dominican Republic Dominican Republic 18.5 +8.23% 120
Algeria Algeria 0.914 -14% 187
Ecuador Ecuador 80.9 +1.55% 24
Egypt Egypt 12.2 +2.92% 136
Eritrea Eritrea 5.79 -8.8% 158
Spain Spain 47 +5.59% 64
Estonia Estonia 40 -18.2% 72
Finland Finland 52.9 +2.05% 60
Fiji Fiji 60.1 +10.1% 55
France France 22.8 -6.39% 102
Faroe Islands Faroe Islands 38.1 -1.57% 77
Micronesia (Federated States of) Micronesia (Federated States of) 4.95 -20.1% 162
Gabon Gabon 33.2 -1.25% 85
United Kingdom United Kingdom 40.3 -8.17% 70
Georgia Georgia 81.4 +8.8% 23
Ghana Ghana 34.9 -4.89% 83
Guinea Guinea 88.1 +42.5% 16
Gambia Gambia 1.6 -1.69% 184
Guinea-Bissau Guinea-Bissau 7.09 0% 147
Equatorial Guinea Equatorial Guinea 8.8 -2.48% 143
Greece Greece 40.5 +10.8% 69
Grenada Grenada 1.97 -0.0859% 182
Greenland Greenland 77 +3.65% 32
Guatemala Guatemala 60.7 -11.1% 54
Guam Guam 4.8 +2.24% 163
Guyana Guyana 7.11 -1.66% 146
Hong Kong SAR China Hong Kong SAR China 0.839 +52.4% 188
Honduras Honduras 64.6 +12.4% 44
Croatia Croatia 69.9 +7.53% 37
Haiti Haiti 19.8 -0.29% 113
Hungary Hungary 19.1 +20.9% 118
Indonesia Indonesia 18.1 +0.564% 123
India India 19.1 -3.15% 119
Ireland Ireland 37.3 -12.4% 78
Iran Iran 4.24 -37.4% 169
Iraq Iraq 3.78 -2.77% 174
Israel Israel 7.63 +23% 144
Italy Italy 41 -3.3% 68
Jamaica Jamaica 12.8 -2.82% 135
Jordan Jordan 24.9 +20.5% 96
Japan Japan 21.1 +4.01% 109
Kazakhstan Kazakhstan 11 +0.606% 140
Kenya Kenya 78.1 -6.1% 30
Kyrgyzstan Kyrgyzstan 85.6 -5.68% 17
Cambodia Cambodia 56.4 +20.1% 58
Kiribati Kiribati 16.4 0% 126
St. Kitts & Nevis St. Kitts & Nevis 4.53 +2.54% 167
South Korea South Korea 6.77 +5.02% 149
Kuwait Kuwait 0.265 +229% 194
Laos Laos 63.3 -4.24% 46
Lebanon Lebanon 5.07 -20.9% 161
Liberia Liberia 57.4 0% 57
Libya Libya 0.0224 -15.2% 200
St. Lucia St. Lucia 2.54 -7.48% 178
Sri Lanka Sri Lanka 49.2 +39.9% 61
Lesotho Lesotho 99.8 -0.0923% 2
Lithuania Lithuania 65.6 +7.91% 42
Luxembourg Luxembourg 89 +0.531% 15
Latvia Latvia 63.6 -0.254% 45
Saint Martin (French part) Saint Martin (French part) 0.811 +18.4% 189
Morocco Morocco 19.3 +3.39% 116
Moldova Moldova 6.5 +12.6% 151
Madagascar Madagascar 34 -19.3% 84
Maldives Maldives 5.82 +4.24% 156
Mexico Mexico 21.5 -0.828% 108
Marshall Islands Marshall Islands 2.43 0% 180
North Macedonia North Macedonia 31 +6.54% 87
Mali Mali 62.3 0% 48
Malta Malta 11.9 +4.93% 138
Myanmar (Burma) Myanmar (Burma) 62.1 -0.188% 49
Montenegro Montenegro 61.8 +18.3% 50
Mongolia Mongolia 10.9 +9.52% 141
Mozambique Mozambique 82.7 -0.644% 21
Mauritania Mauritania 19.4 +2.36% 115
Mauritius Mauritius 21.7 -10.2% 107
Malawi Malawi 80.1 +0.979% 25
Malaysia Malaysia 17 -3.25% 125
Namibia Namibia 90.9 +8.89% 12
New Caledonia New Caledonia 22.5 +44% 105
Niger Niger 6.38 -6.79% 153
Nigeria Nigeria 23.8 +13.1% 98
Nicaragua Nicaragua 69.5 -1.01% 38
Netherlands Netherlands 33.1 +24.8% 86
Norway Norway 99.1 +0.684% 4
Nepal Nepal 83.8 -10.2% 19
Nauru Nauru 9.82 +46.7% 142
New Zealand New Zealand 81.4 +1.25% 22
Oman Oman 1.95 +369% 183
Pakistan Pakistan 28.3 -12.3% 90
Panama Panama 79.3 +1.06% 27
Peru Peru 61.3 -4.23% 52
Philippines Philippines 22.7 +6.22% 104
Palau Palau 4.6 +17.3% 165
Papua New Guinea Papua New Guinea 40 +0.107% 71
Poland Poland 17.5 -5.11% 124
Puerto Rico Puerto Rico 4.58 +14.1% 166
North Korea North Korea 63.2 +18.3% 47
Portugal Portugal 64.9 +8.85% 43
Palestinian Territories Palestinian Territories 24.5 +15% 97
French Polynesia French Polynesia 23.7 -22% 99
Qatar Qatar 0.276 -4.61% 193
Romania Romania 44.9 +0.657% 65
Russia Russia 19.2 -4.59% 117
Rwanda Rwanda 61 -5.42% 53
Saudi Arabia Saudi Arabia 0.0653 -3.48% 198
Sudan Sudan 58 -11.1% 56
Senegal Senegal 13.3 +43.9% 134
Singapore Singapore 4.02 -1.45% 171
Solomon Islands Solomon Islands 6.56 +10.7% 150
Sierra Leone Sierra Leone 75.3 +0.00609% 34
El Salvador El Salvador 95.6 +10.9% 6
Somalia Somalia 11.2 +36.4% 139
Serbia Serbia 35 +21.2% 82
South Sudan South Sudan 0.34 +51.7% 192
São Tomé & Príncipe São Tomé & Príncipe 6.06 +3.65% 155
Suriname Suriname 41.9 +22.9% 66
Slovakia Slovakia 23.6 -4.83% 100
Slovenia Slovenia 36.1 +5.7% 79
Sweden Sweden 67.4 -1.59% 40
Eswatini Eswatini 83.1 +4.81% 20
Sint Maarten Sint Maarten 0 203
Seychelles Seychelles 4.51 +52.3% 168
Syria Syria 3.91 +1.41% 172
Turks & Caicos Islands Turks & Caicos Islands 1.48 +159% 186
Chad Chad 4.64 -18.2% 164
Togo Togo 25.6 +72.6% 93
Thailand Thailand 19.7 +5.81% 114
Tajikistan Tajikistan 93.4 -2.99% 7
Turkmenistan Turkmenistan 0.0111 -9.29% 202
Timor-Leste Timor-Leste 0.371 -0.49% 191
Tonga Tonga 14.2 -0.0952% 131
Trinidad & Tobago Trinidad & Tobago 0.0676 -0.389% 197
Tunisia Tunisia 2.82 -9.23% 177
Turkey Turkey 35.4 -15.4% 80
Tuvalu Tuvalu 15.8 0% 127
Tanzania Tanzania 39.4 -9.38% 74
Uganda Uganda 90 -6.94% 14
Ukraine Ukraine 12 -6.02% 137
Uruguay Uruguay 84.4 -10% 18
United States United States 20.3 +1.79% 112
Uzbekistan Uzbekistan 7.08 -6.18% 148
St. Vincent & Grenadines St. Vincent & Grenadines 15 -10.9% 129
Venezuela Venezuela 75.4 -2.92% 33
British Virgin Islands British Virgin Islands 2.25 -0.294% 181
U.S. Virgin Islands U.S. Virgin Islands 2.5 +10.2% 179
Vietnam Vietnam 41.2 +15.2% 67
Vanuatu Vanuatu 25.2 -11.5% 95
Samoa Samoa 49.1 +3.32% 62
Kosovo Kosovo 6.37 +17.7% 154
Yemen Yemen 21.1 +10.5% 110
South Africa South Africa 6.46 +7.42% 152
Zambia Zambia 92.1 +7.63% 10
Zimbabwe Zimbabwe 72.6 +19.5% 36

The indicator of renewable electricity output as a percentage of total electricity output plays a crucial role in assessing the energy landscape of any country or region. This metric signifies the proportion of electricity generated from renewable sources—such as solar, wind, hydroelectric, and biomass—relative to all electricity produced. The increasing focus on sustainable energy solutions brings this indicator to the forefront of discussions concerning climate change, energy independence, and economic development.

One of the primary reasons for monitoring renewable electricity output is its direct relation to greenhouse gas emissions. The burning of fossil fuels for electricity is a leading cause of CO2 emissions, contributing significantly to global warming. As nations pivot towards cleaner energy sources, the increase in renewable electricity output is vital for mitigating climate change impacts. Furthermore, as the urgency to address global challenges like air pollution, land degradation, and energy security grows, this indicator helps stakeholders evaluate their progress toward a sustainable future.

This metric does not exist in isolation; rather, it interacts with various other indicators. For example, the level of investment in renewable energy technologies correlates strongly with renewable electricity output. Countries that allocate financial resources toward solar, wind, and other renewable infrastructure typically see increases in their renewable share. Additionally, the political landscape can affect this indicator. Policies promoting clean energy adoption, such as subsidies for renewable projects or legislative mandates for cleaner grid standards, significantly boost renewable electricity contributions to total energy output.

Many factors influence the renewable electricity output percentage. Geographic factors play a crucial role; for instance, regions endowed with natural resources conducive to renewable energy (like high wind speeds or ample sunlight) are likely to achieve higher outputs. Moreover, technological advancements improve the efficiency and economics of renewable energy generation, further supporting higher output ratios. Economic factors also come into play, as countries with stronger economies often have more resources to invest in renewable infrastructure and research. Conversely, regions relying heavily on fossil fuels may have a lower percentage, reflecting the challenges of transitioning to greener alternatives.

Strategies to increase renewable electricity output typically encompass a multi-faceted approach. Policymakers may implement feeding tariff systems to guarantee fixed payments for renewable energy producers, incentivizing investments in these sectors. Incorporation of energy storage solutions, such as batteries, can help manage supply and demand discrepancies inherent in renewable energies, thus enhancing their contribution to the overall electricity mix. Additionally, public awareness campaigns can encourage energy conservation and a preference for cleaner energy sources among consumers.

Despite its importance, this indicator also has its flaws. Variability in renewable output, due to dependency on weather and climatic conditions, presents a challenge in maintaining a stable energy supply. For example, while wind and solar power can generate significant electricity output during favorable conditions, they can fall short during periods of low wind or reduced sunlight. Furthermore, the grid infrastructure in many regions may not be adequately designed to handle high levels of renewable energy, resulting in potential bottlenecks and inefficiencies.

Examining the latest data, we find that in 2019, the median value of renewable electricity output worldwide was 16.25%. Indonesia is presented as both a top and bottom performer with this figure, indicative perhaps of its unique energy profile or the challenges it faces in scaling local renewable efforts. It's worth noting that the global figures have fluctuated over the decades. For instance, the renewable electricity output percentage has shown declining trends from 19.36% in 1990 down to lower values in subsequent years, until peaking again around the mid-2010s.

The available statistics indicate that between 1990 and 2015, while the global population has increasingly recognized the need for greener energy solutions, the actual renewable share has faced substantial oscillations, hitting a low of 17.38% in 2003 before starting to rise again. The peak in 2012 at 20.9% and onwards shows an emerging positive trend toward integrating renewable energy sources, illustrating both international efforts and technological improvements.

In conclusion, the renewable electricity output indicator is a vital measure that encapsulates not only the potential to combat climate change but also signifies the broader economic and technological transitions that countries are undergoing. Continuous efforts must be directed towards overcoming existing challenges, creating actionable policies that encourage renewable investment, increasing public engagement, and pursuing innovations in the energy sector. By unlocking the full potential of renewable resources, regions can enhance energy security, improve public health through cleaner air, and contribute to a more sustainable global ecosystem.

                    
# 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.ELC.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.ELC.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))