Life expectancy at birth, total (years)

Source: worldbank.org, 01.09.2025

Year: 2023

Flag Country Value Value change, % Rank
Aruba Aruba 76.4 +0.167% 91
Afghanistan Afghanistan 66 +0.637% 183
Angola Angola 64.6 +0.577% 190
Albania Albania 79.6 +1.06% 53
Andorra Andorra 84 +0.0298% 8
United Arab Emirates United Arab Emirates 82.9 +3.01% 24
Argentina Argentina 77.4 +2.1% 78
Armenia Armenia 77.5 +3.61% 77
American Samoa American Samoa 72.9 +0.137% 125
Antigua & Barbuda Antigua & Barbuda 77.6 +0.148% 74
Australia Australia 83.1 -0.179% 21
Austria Austria 81.5 +0.303% 39
Azerbaijan Azerbaijan 74.4 +0.41% 110
Burundi Burundi 63.7 +1.22% 195
Belgium Belgium 82.4 +0.794% 28
Benin Benin 60.8 +0.494% 208
Burkina Faso Burkina Faso 61.1 +0.646% 207
Bangladesh Bangladesh 74.7 +0.548% 106
Bulgaria Bulgaria 75.7 +2.09% 97
Bahrain Bahrain 81.3 +0.361% 41
Bahamas Bahamas 74.6 +0.0819% 108
Bosnia & Herzegovina Bosnia & Herzegovina 77.9 +1.4% 68
Belarus Belarus 74.2 +0.109% 112
Belize Belize 73.6 +1.91% 117
Bermuda Bermuda 82.3 +0.301% 30
Bolivia Bolivia 68.6 +1.7% 161
Brazil Brazil 75.8 +1.3% 96
Barbados Barbados 76.2 +0.663% 94
Brunei Brunei 75.3 +3.31% 99
Bhutan Bhutan 73 +0.304% 122
Botswana Botswana 69.2 +0.602% 157
Central African Republic Central African Republic 57.4 +205% 213
Canada Canada 81.6 +0.494% 38
Switzerland Switzerland 84.1 +0.54% 6
Chile Chile 81.2 +2.51% 43
China China 78 -0.318% 67
Côte d’Ivoire Côte d’Ivoire 61.9 +0.621% 203
Cameroon Cameroon 63.7 +2.01% 194
Congo - Kinshasa Congo - Kinshasa 61.9 +1.5% 204
Congo - Brazzaville Congo - Brazzaville 65.8 +1.19% 186
Colombia Colombia 77.7 +1.59% 72
Comoros Comoros 66.8 +0.445% 177
Cape Verde Cape Verde 76.1 +0.2% 95
Costa Rica Costa Rica 80.8 +1.87% 46
Cuba Cuba 78.1 +0.587% 63
Curaçao Curaçao 76.8 +0.0925% 84
Cayman Islands Cayman Islands 80.4 +0.468% 49
Cyprus Cyprus 81.6 +1.51% 37
Czechia Czechia 79.9 +1.2% 52
Germany Germany 80.5 -0.0826% 47
Djibouti Djibouti 66 +0.682% 184
Dominica Dominica 71.1 +0.0717% 146
Denmark Denmark 81.9 +0.675% 34
Dominican Republic Dominican Republic 73.7 -0.662% 114
Algeria Algeria 76.3 +0.173% 92
Ecuador Ecuador 77.4 +1.06% 79
Egypt Egypt 71.6 +0.877% 139
Eritrea Eritrea 68.6 +1.23% 160
Spain Spain 83.9 +0.901% 9
Estonia Estonia 78.5 +0.83% 59
Ethiopia Ethiopia 67.3 +0.625% 171
Finland Finland 81.7 +0.613% 36
Fiji Fiji 67.3 +0.25% 170
France France 82.9 +0.974% 23
Faroe Islands Faroe Islands 83.1 +0.241% 19
Micronesia (Federated States of) Micronesia (Federated States of) 67.2 +0.354% 172
Gabon Gabon 68.3 +0.922% 163
United Kingdom United Kingdom 81.2 +0.28% 42
Georgia Georgia 74.5 +0.479% 109
Ghana Ghana 65.5 +0.386% 187
Gibraltar Gibraltar 83.6 +0.0431% 11
Guinea Guinea 60.7 +0.51% 209
Gambia Gambia 65.9 +1.54% 185
Guinea-Bissau Guinea-Bissau 64.1 +0.755% 192
Equatorial Guinea Equatorial Guinea 63.7 +0.556% 193
Greece Greece 81.5 +0.927% 40
Grenada Grenada 75.2 +0.0719% 102
Greenland Greenland 71.5 +0.013% 140
Guatemala Guatemala 72.6 +1.96% 127
Guam Guam 77.2 +0.139% 81
Guyana Guyana 70.2 +0.418% 150
Hong Kong SAR China Hong Kong SAR China 85.2 +1.9% 3
Honduras Honduras 72.9 +0.232% 124
Croatia Croatia 78.5 +1.16% 60
Haiti Haiti 64.9 +1.55% 189
Hungary Hungary 76.8 +1.19% 85
Indonesia Indonesia 71.1 +0.312% 145
Isle of Man Isle of Man 81 +0.0531% 45
India India 72 +0.425% 136
Ireland Ireland 82.9 +0.426% 26
Iran Iran 77.7 +1.11% 73
Iraq Iraq 72.3 +0.398% 130
Iceland Iceland 82.6 +0.594% 27
Israel Israel 83.2 +0.599% 16
Italy Italy 83.7 +1.21% 10
Jamaica Jamaica 71.5 -0.0028% 141
Jordan Jordan 77.8 +0.942% 70
Japan Japan 84 +0.0534% 7
Kazakhstan Kazakhstan 74.4 +1.22% 111
Kenya Kenya 63.6 +0.153% 196
Kyrgyzstan Kyrgyzstan 72.2 +0.278% 131
Cambodia Cambodia 70.7 +0.199% 147
Kiribati Kiribati 66.5 +0.308% 178
St. Kitts & Nevis St. Kitts & Nevis 72.1 +2.61% 132
South Korea South Korea 83.4 +0.906% 13
Kuwait Kuwait 83.2 +3.23% 17
Laos Laos 69 +0.362% 158
Lebanon Lebanon 77.8 -0.238% 69
Liberia Liberia 62.2 +0.37% 201
Libya Libya 69.3 -6.88% 154
St. Lucia St. Lucia 72.7 +0.0372% 126
Liechtenstein Liechtenstein 84.8 +0.855% 4
Sri Lanka Sri Lanka 77.5 +0.237% 76
Lesotho Lesotho 57.4 +0.991% 214
Lithuania Lithuania 77 +1.78% 83
Luxembourg Luxembourg 83.4 +0.497% 14
Latvia Latvia 75.7 +1.88% 98
Macao SAR China Macao SAR China 83.2 +0.12% 18
Saint Martin (French part) Saint Martin (French part) 80.2 -0.015% 50
Morocco Morocco 75.3 +0.202% 101
Monaco Monaco 86.4 +0.73% 1
Moldova Moldova 71.2 -0.486% 144
Madagascar Madagascar 63.6 +0.894% 197
Maldives Maldives 81 +0.348% 44
Mexico Mexico 75.1 +1.48% 103
Marshall Islands Marshall Islands 66.9 +0.33% 175
North Macedonia North Macedonia 75.3 +1.2% 100
Mali Mali 60.4 +0.673% 210
Malta Malta 83.5 +1.28% 12
Myanmar (Burma) Myanmar (Burma) 66.9 +0.576% 176
Montenegro Montenegro 77.6 +1.84% 75
Mongolia Mongolia 72.1 +0.308% 133
Northern Mariana Islands Northern Mariana Islands 78.8 +0.353% 55
Mozambique Mozambique 63.6 +0.952% 198
Mauritania Mauritania 68.5 +0.297% 162
Mauritius Mauritius 73.4 -0.139% 120
Malawi Malawi 67.4 +1.99% 169
Malaysia Malaysia 76.7 +1.61% 86
Namibia Namibia 67.4 +4.98% 168
New Caledonia New Caledonia 78.8 +1.37% 56
Niger Niger 61.2 +1.3% 206
Nigeria Nigeria 54.5 +0.708% 216
Nicaragua Nicaragua 74.9 +0.65% 105
Netherlands Netherlands 81.9 +0.368% 33
Norway Norway 83.1 +0.73% 20
Nepal Nepal 70.4 +0.381% 149
Nauru Nauru 62.1 +0.289% 202
New Zealand New Zealand 83 +1.28% 22
Oman Oman 80 +2.72% 51
Pakistan Pakistan 67.6 +0.344% 167
Panama Panama 79.6 +0.34% 54
Peru Peru 77.7 +1.18% 71
Philippines Philippines 69.8 +0.52% 152
Palau Palau 69.3 +0.503% 156
Papua New Guinea Papua New Guinea 66.1 +1.32% 182
Poland Poland 78.5 +1.75% 58
Puerto Rico Puerto Rico 81.7 +2.85% 35
North Korea North Korea 73.6 +0.00136% 115
Portugal Portugal 82.3 +0.795% 31
Paraguay Paraguay 73.8 +2.11% 113
Palestinian Territories Palestinian Territories 65.2 -15% 188
French Polynesia French Polynesia 84.1 +0.252% 5
Qatar Qatar 82.4 +0.624% 29
Romania Romania 76.6 +1.93% 87
Russia Russia 73.3 +0.977% 121
Rwanda Rwanda 67.8 +0.381% 165
Saudi Arabia Saudi Arabia 78.7 +1.84% 57
Sudan Sudan 66.3 +0.968% 180
Senegal Senegal 68.7 +1.32% 159
Singapore Singapore 82.9 0% 25
Solomon Islands Solomon Islands 70.5 +0.169% 148
Sierra Leone Sierra Leone 61.8 +0.834% 205
El Salvador El Salvador 72.1 +0.181% 135
San Marino San Marino 85.7 -0.00233% 2
Somalia Somalia 58.8 +9.06% 211
Serbia Serbia 76.2 +1.31% 93
South Sudan South Sudan 57.6 +0.724% 212
São Tomé & Príncipe São Tomé & Príncipe 69.7 +0.695% 153
Suriname Suriname 73.6 +0.515% 116
Slovakia Slovakia 78 +1.37% 65
Slovenia Slovenia 82 +0.855% 32
Sweden Sweden 83.3 +0.302% 15
Eswatini Eswatini 64.1 +1.74% 191
Sint Maarten Sint Maarten 76.4 +0.251% 90
Seychelles Seychelles 75 +1.7% 104
Syria Syria 72.1 -0.92% 134
Turks & Caicos Islands Turks & Caicos Islands 78 +0.116% 66
Chad Chad 55.1 +0.992% 215
Togo Togo 62.7 +0.721% 200
Thailand Thailand 76.4 +1.49% 89
Tajikistan Tajikistan 71.8 +0.319% 137
Turkmenistan Turkmenistan 70.1 +0.229% 151
Timor-Leste Timor-Leste 67.7 +0.476% 166
Tonga Tonga 72.9 +0.358% 123
Trinidad & Tobago Trinidad & Tobago 73.5 +0.217% 118
Tunisia Tunisia 76.5 +0.602% 88
Turkey Turkey 77.2 -0.561% 82
Tuvalu Tuvalu 67.1 +0.378% 173
Tanzania Tanzania 67 +0.173% 174
Uganda Uganda 68.3 +0.853% 164
Ukraine Ukraine 73.4 +1.05% 119
Uruguay Uruguay 78.1 +2.18% 62
United States United States 78.4 +1.23% 61
Uzbekistan Uzbekistan 72.4 +0.334% 129
St. Vincent & Grenadines St. Vincent & Grenadines 71.2 +0.0548% 143
Venezuela Venezuela 72.5 -0.0717% 128
British Virgin Islands British Virgin Islands 77.3 +0.128% 80
U.S. Virgin Islands U.S. Virgin Islands 80.5 +0.249% 48
Vietnam Vietnam 74.6 +0.115% 107
Vanuatu Vanuatu 71.5 +0.245% 142
Samoa Samoa 71.7 +0.207% 138
Kosovo Kosovo 78 +0.528% 64
Yemen Yemen 69.3 +1.98% 155
South Africa South Africa 66.1 +1.05% 181
Zambia Zambia 66.3 +1.64% 179
Zimbabwe Zimbabwe 62.8 +0.665% 199

Life expectancy at birth, total (years) serves as a crucial demographic indicator that reflects the average number of years a newborn is expected to live, assuming that current mortality rates remain constant throughout their lifetime. This metric provides insights into the overall health of a population, highlighting the effectiveness of healthcare systems, social conditions, and economic development. As of 2022, the global median life expectancy is 73.51 years, an important marker that showcases improvements in health standards compared to previous decades.

The significance of life expectancy at birth extends beyond mere numbers; it is an essential determinant of public health policies and economic strategies. Regions with higher life expectancy figures typically enjoy better health infrastructure, access to quality medical care, and healthier lifestyles. For instance, the leading areas for life expectancy include Macao SAR China, with a remarkable 85.38 years, followed closely by Liechtenstein (84.32 years), Japan (84.0 years), Hong Kong SAR China (83.66 years), and French Polynesia (83.55 years). These regions could be perceived as benchmarks in global health, often demonstrating successful healthcare systems accompanied by economic prosperity and social stability.

Conversely, the strikingly lower figures in the bottom five areas—Chad (53.0 years), Lesotho (53.04 years), Nigeria (53.63 years), the Central African Republic (54.48 years), and South Sudan (55.57 years)—underscore the critical issues faced by many developing nations. These countries often suffer from inadequate health services, infectious diseases, malnutrition, conflict, and poverty, which drastically reduce life expectancy. This stark contrast between the top and bottom areas illustrates the disparities in global health and living conditions, further emphasizing the importance of global efforts to bridge such gaps.

Life expectancy is intricately tied to several other socio-economic indicators. For example, higher life expectancy correlates with lower infant mortality rates, better education levels, increased per capita income, and improved sanitation facilities. Nations with investments in healthcare and education consistently achieve longer life spans, suggesting a holistic approach is necessary to enhance overall life expectancy. In past decades, global life expectancy has seen substantial improvement; it has risen from a mere 50.91 years in 1960 to approximately 71.95 years in 2022. This trajectory reflects advances in medical technology, public health initiatives, and a growing understanding of health determinants.

Factors affecting life expectancy include genetics, lifestyle choices, access to healthcare, nutrition, and public health policies. Behavioral factors, such as smoking, alcohol consumption, and physical activity levels also play significant roles. Countries adopting comprehensive wellness initiatives, promoting healthy lifestyles, and prioritizing preventive healthcare are more likely to experience higher life expectancy rates. Environmental factors, like pollution and climate change, also pose long-term threats to health and life expectancy, requiring increasingly proactive strategies from governments and international organizations.

To address disparities in life expectancy, a multifaceted approach is vital. Strategies can include improving healthcare accessibility, particularly in rural and underprivileged areas, enhancing education and community health programs focused on maternal and child health, and promoting awareness about healthy lifestyle choices. Global partnerships, like those with the World Health Organization, emphasize a united front in combatting health disparities. Additionally, innovative solutions such as telemedicine and mobile health clinics can extend healthcare access beyond traditional boundaries, reaching remote populations effectively.

While the upward trend in life expectancy at birth is commendable, it isn't without its flaws. The data can mask underlying socio-economic issues, especially in high-income countries, where life expectancy may hide disparities among different population subgroups affected by race, ethnicity, or economic status. Moreover, during crises such as the COVID-19 pandemic, life expectancy can experience abrupt declines, revealing vulnerabilities in public health infrastructure. The data from 2020 and 2021 shows a dip in global life expectancy due to the pandemic, indicating that resilience and adaptability in health systems are essential in coping with sudden health emergencies.

In conclusion, life expectancy at birth provides invaluable insight into a population's health and wellness and serves as a critical benchmark for evaluating public health initiatives. As demonstrated through the differences between various regions worldwide, it is clear that socio-economic conditions significantly influence health outcomes. By addressing the factors affecting life expectancy, investing in health infrastructure, and implementing comprehensive health policies, nations can work towards improving the quality of life for their citizens and achieving sustainable, equitable health outcomes going forward.

                    
# 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 = 'SP.DYN.LE00.IN'

# 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 <- 'SP.DYN.LE00.IN'

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