Government expenditure on education, total (% of GDP)

Source: worldbank.org, 01.09.2025

Year: 2023

Flag Country Value Value change, % Rank
Andorra Andorra 1.93 -27.2% 58
Armenia Armenia 0.243 -90.3% 64
Azerbaijan Azerbaijan 3.58 +17.6% 40
Bangladesh Bangladesh 1.78 +3.7% 61
Belarus Belarus 4.95 +6.98% 23
Belize Belize 4.26 -7.42% 27
Bermuda Bermuda 1.93 +0.595% 57
Barbados Barbados 4.04 -8.41% 31
Bhutan Bhutan 5.85 -21.7% 14
Côte d’Ivoire Côte d’Ivoire 3.43 -2.34% 42
Dominica Dominica 4.66 -22.9% 25
Algeria Algeria 5.61 +18.1% 17
Ecuador Ecuador 3.89 +8.19% 33
Fiji Fiji 4.25 +7.83% 28
Georgia Georgia 3.74 -0.436% 36
Gambia Gambia 2.7 -1.69% 52
Guatemala Guatemala 3.18 -1.55% 45
Hong Kong SAR China Hong Kong SAR China 3.8 +2% 34
Honduras Honduras 4.05 -8.9% 30
Indonesia Indonesia 1.28 +47.6% 62
Iran Iran 2.93 -4.3% 49
Jamaica Jamaica 5.65 +5.61% 16
Kenya Kenya 3.96 -12.2% 32
Kyrgyzstan Kyrgyzstan 6.83 -4.77% 5
Cambodia Cambodia 2.95 +2.35% 48
Kuwait Kuwait 5.03 -23.6% 22
Laos Laos 1.23 -15.5% 63
Sri Lanka Sri Lanka 1.83 +51.8% 60
Lesotho Lesotho 6.69 +4.02% 8
Morocco Morocco 6.02 +1.84% 13
Moldova Moldova 6.25 +2.33% 10
Maldives Maldives 5.17 +10.6% 19
Mongolia Mongolia 3.74 -10.5% 35
Mauritania Mauritania 2.65 +8.43% 53
Mauritius Mauritius 4.57 -5.64% 26
Malaysia Malaysia 3.63 +3.66% 38
Namibia Namibia 9.04 -6.54% 3
Nepal Nepal 3.68 +1.75% 37
Pakistan Pakistan 1.87 -5.36% 59
Peru Peru 4.24 +10.5% 29
Philippines Philippines 3.62 +1.23% 39
Palau Palau 3.44 -3.89% 41
Paraguay Paraguay 3.41 +0.303% 43
Rwanda Rwanda 4.92 +3.66% 24
Saudi Arabia Saudi Arabia 5.11 -0.45% 21
Singapore Singapore 2.19 -12.1% 56
Solomon Islands Solomon Islands 8.29 -2.28% 4
Sierra Leone Sierra Leone 6.79 -20.5% 6
El Salvador El Salvador 3.17 -2.58% 46
Suriname Suriname 2.87 -16.5% 50
Eswatini Eswatini 6.31 +10.9% 9
Turks & Caicos Islands Turks & Caicos Islands 3.14 -23.7% 47
Thailand Thailand 2.52 -3.47% 55
Tajikistan Tajikistan 5.81 +1.67% 15
Turkmenistan Turkmenistan 2.75 -26.4% 51
Tonga Tonga 5.15 -8.87% 20
Tunisia Tunisia 6.73 -1.04% 7
Tuvalu Tuvalu 12.8 +272% 1
Tanzania Tanzania 3.26 +0.677% 44
Uganda Uganda 2.55 -0.369% 54
Uzbekistan Uzbekistan 5.47 +4.55% 18
Vanuatu Vanuatu 10.6 -0.56% 2
Samoa Samoa 6.11 +25.3% 12
South Africa South Africa 6.15 -0.306% 11

The indicator 'Government expenditure on education, total (% of GDP)' serves as a critical metric for assessing how much national governments are investing in education relative to their overall economic capacity. It reflects the prioritization of education within public policy and is a crucial determinant in a country’s development trajectory. This expenditure is significant as it directly influences educational quality, accessibility, and the overall effectiveness of educational systems.

In 2023, the median value for government expenditure on education globally stands at 3.93% of GDP. This figure emphasizes a growing recognition of education's central role in societal progress. However, when we delve deeper into the data, the disparities become evident. For instance, nations such as Tuvalu (12.85%), Vanuatu (10.64%), Namibia (9.04%), Solomon Islands (8.29%), and Kyrgyzstan (6.83%) occupy the top five positions in government education spending as a percentage of GDP. These countries exemplify the broad recognition that investing in education is foundational for national development, leading to improved economic outcomes and enhanced quality of life.

In contrast, several countries fall significantly short on this indicator. The bottom five—Armenia (0.24%), Laos (1.23%), Indonesia (1.28%), Bangladesh (1.78%), and Sri Lanka (1.83%)—illustrate the perilous implications of underinvestment in education. Such low expenditure highlights potential issues, including lower educational attainment, limited skill development, and a workforce ill-prepared for the demands of an evolving global economy. Countries with lower education spending may also grapple with issues like poverty, reduced social mobility, and constrained economic growth.

The importance of government expenditure on education transcends its immediate economic implications. Educational investment is inherently linked to various other indicators such as poverty rates, unemployment levels, and health outcomes. For instance, countries that allocate more resources to education tend to experience lower unemployment rates and better health outcomes, as a well-educated population often possesses the skills necessary to adapt to changing job markets and engage in healthier lifestyle choices. Furthermore, education plays a vital role in fostering innovation and driving economic growth, particularly in today’s knowledge-based economies.

Several factors affect government expenditure on education as a percentage of GDP. Economic conditions, political will, and societal values play pivotal roles in determining educational budgets. During economic downturns, governments may prioritize other areas like infrastructure or welfare programs, leading to reduced funding for education. Conversely, countries experiencing robust economic growth may have more flexibility in increasing educational spending, evidencing a direct correlation between economic performance and educational investment. Political stability and public demand for quality education can also motivate increased funding, showing that when citizens advocate for educational improvements, governments are more likely to respond positively.

Implementing effective strategies to enhance government expenditure on education requires a multi-faceted approach. Policymakers must ensure transparency and accountability in educational spending, ensuring that funds allocated to education are used efficiently and effectively. Additionally, creating public-private partnerships can introduce innovative practices and resources into the educational sector, augmenting government efforts. International cooperation and funding can also contribute to boosting educational expenditure, especially in developing nations that may lack the required financial resources.

However, flaws can emerge in the administration of educational expenditures. Simply increasing the percentage of GDP spent on education does not guarantee better educational outcomes. The efficiency of spending is equally important; without a focus on infrastructure, teacher training, curriculum development, and technological integration, increased funding may not translate into improved educational quality. Moreover, disparities within countries could persist, where increased spending focuses on urban areas while neglecting rural education needs, exacerbating existing inequalities.

A historical perspective reveals that global trends in government expenditure on education have fluctuated. In 1999, the world average was 4.06%, indicating a relatively higher commitment to education at that time. As the years progressed, expenditures remained relatively stable, hovering around the 4% mark until a noticeable decline emerged, reaching 3.77% in 2022. The decline suggests potential challenges in maintaining commitment to education amidst competing budgetary demands, particularly during periods of economic strain or global challenges such as the COVID-19 pandemic, which disrupted educational systems worldwide.

To synthesize, the indicator of government expenditure on education as a percentage of GDP is a critical insight into a nation’s commitment to fostering a knowledgeable, skilled society. The stark differences in educational investment reflect underlying socio-economic conditions, highlighting the need for targeted policies that prioritize education regardless of economic status. By acknowledging the importance of educational investment and implementing effective strategies, nations can secure future growth and improve the quality of life for their citizens.

Ultimately, the investment in education forms the bedrock of human development, shaping not only individual prospects but also the collective potential of societies worldwide. It is imperative for governments to recognize education not merely as a budget line item, but as a pivotal investment for sustainable growth and social equity.

                    
# 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 = 'SE.XPD.TOTL.GD.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 <- 'SE.XPD.TOTL.GD.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))