Electric power consumption (kWh per capita)

Source: worldbank.org, 01.09.2025

Year: 2023

Flag Country Value Value change, % Rank
Australia Australia 9,832 -1.02% 9
Austria Austria 7,772 -5.91% 11
Belgium Belgium 6,757 -7.22% 13
Brazil Brazil 2,916 +4.62% 35
Canada Canada 14,153 -3.01% 4
Switzerland Switzerland 7,096 -2.92% 12
Chile Chile 4,240 -4.12% 30
Costa Rica Costa Rica 2,068 -2.7% 37
Czechia Czechia 5,988 -5.9% 20
Germany Germany 6,000 -4.53% 19
Denmark Denmark 5,929 +1.01% 21
Spain Spain 5,111 -1.33% 24
Estonia Estonia 5,749 -11.1% 22
Finland Finland 14,352 -2.69% 3
France France 6,457 -3.31% 16
United Kingdom United Kingdom 4,135 -4.61% 32
Greece Greece 4,534 -6.08% 28
Hungary Hungary 4,602 -2.09% 26
Ireland Ireland 6,058 -0.212% 18
Iceland Iceland 50,083 -2.29% 1
Israel Israel 6,561 -4.12% 14
Italy Italy 5,050 -3.18% 25
Kenya Kenya 190 +0.384% 38
South Korea South Korea 11,308 -1.61% 7
Lithuania Lithuania 4,203 -4.83% 31
Luxembourg Luxembourg 11,168 -3.96% 8
Latvia Latvia 3,629 -1.83% 33
Mexico Mexico 2,413 +2.59% 36
Netherlands Netherlands 6,198 -2.63% 17
Norway Norway 23,520 +0.627% 2
New Zealand New Zealand 7,908 -2.36% 10
Poland Poland 4,356 -5.24% 29
Portugal Portugal 5,143 +1.14% 23
Slovakia Slovakia 4,577 -7.68% 27
Slovenia Slovenia 6,470 -3.87% 15
Sweden Sweden 12,122 -2.39% 6
Turkey Turkey 3,523 -0.892% 34
United States United States 12,645 -2.5% 5

Electric power consumption (kWh per capita) is a vital indicator reflecting the average energy usage per person in a specific country or region. It is a critical metric that showcases how much electricity is consumed by individuals and serves as a proxy for a country's economic development, energy efficiency, and overall quality of life. As societies evolve, energy consumption tends to increase, correlating with advancements in living standards, industrial growth, and technological innovations.

The importance of tracking electric power consumption lies in its multifaceted implications. High per capita consumption can suggest a prosperous and developing economy where residents have access to reliable energy for their daily activities, such as heating, cooling, and powering electronic devices. Conversely, low consumption can indicate economic challenges, lower living standards, or a lack of infrastructure. Monitoring changes in this indicator can help policymakers gauge the success of initiatives aimed at improving energy access and efficiency, as well as the environmental impact of energy production.

Electric power consumption also interrelates with various other indicators. For instance, there is a notable connection between electricity usage and GDP per capita. As nations become wealthier, their demand for energy typically increases to support industrial activities and improve living conditions. Additionally, per capita consumption is linked with environmental indicators, such as carbon emissions. Higher electricity use can result in increased emissions unless sourced from renewable energy. Therefore, understanding electric power consumption enables a holistic view of a country's progress across economic, social, and environmental spectrums.

Several factors influence electric power consumption at both macro and micro levels. Economic development and urbanization are among the primary drivers of increased energy use, as growing populations and cities require more electricity for infrastructure and services. Moreover, technological advancements can either increase or decrease consumption. For instance, energy-efficient appliances can reduce the overall demand for electricity, while the proliferation of air conditioning units in warmer climates can significantly raise consumption rates. Additionally, cultural factors and lifestyle choices play a role, with communities that emphasize the use of electric-powered conveniences generally consuming more energy.

Strategies aimed at enhancing electric power consumption often revolve around sustainability and efficiency. Governments and organizations can promote renewable energy sources such as solar and wind to reduce reliance on fossil fuels, thus mitigating environmental impacts while meeting energy demands. Additionally, energy conservation campaigns can encourage residents to adopt energy-saving practices, such as using LED lighting and energy-efficient appliances. Investment in smart grid technologies can also optimize energy distribution and consumption, significantly enhancing overall efficiency.

Nevertheless, while electric power consumption serves as an important metric, it is not without flaws. For instance, the indicator may not fully capture the distribution of energy access within populations. A country may have high per capita consumption on average, but this doesn’t account for disparities between urban and rural areas, or among different socioeconomic groups. Therefore, merely examining average consumption could lead to oversight of critical inequalities. Furthermore, the quality of electricity supplied—whether it is reliable and affordable—also significantly influences its impact on residents' lives. Thus, focusing solely on quantitative aspects without examining qualitative ones may result in an incomplete understanding of energy usage dynamics.

Reviewing the latest data for electric power consumption, which for 2019 stands at a median value of 1084.0 kWh per capita, offers a glimpse into global trends. Interestingly, Indonesia appears both in the top and bottom five areas with the same consumption value of 1084.0, suggesting that while it exemplifies a demanding energy environment, there may not be significant variability within its regions. Analyzing historical trends from the data collected since 1971 reveals a general upward trajectory of global electric power consumption, escalating from 1201.19 kWh per capita in 1971 to over 3090 kWh by 2014.

This upward trend highlights how electricity consumption reflects not only population growth but also technological advancement and lifestyle changes. The steady increase suggests a world that is becoming more energy-dependent as economies expand, industries modernize, and populations become increasingly urbanized. For instance, the world values indicate that electricity consumption saw notable spikes in the early 2000s, coinciding with rapid industrialization in many developing countries, a trend that may continue as nations strive to enhance their energy infrastructures to meet growing demands.

In conclusion, electric power consumption (kWh per capita) is an essential indicator that provides insights into economic health, energy policies, and societal progress. Understanding its nuances, alongside grappling with the inherent disparities in consumption patterns, will be fundamental for policymakers dedicated to fostering sustainable energy practices and building equitable access to electricity around the globe.

                    
# 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.USE.ELEC.KH.PC'

# 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.USE.ELEC.KH.PC'

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