Total reserves (% of total external debt)

Source: worldbank.org, 03.09.2025

Year: 2023

Flag Country Value Value change, % Rank
Angola Angola 24.4 +8.22% 67
Albania Albania 56.8 +12.4% 26
Argentina Argentina 8.67 -48.3% 92
Armenia Armenia 22.8 -11.8% 69
Azerbaijan Azerbaijan 94.6 +27.5% 14
Burundi Burundi 8.66 -47.8% 93
Bangladesh Bangladesh 21.5 -38.1% 73
Bosnia & Herzegovina Bosnia & Herzegovina 65.7 +0.375% 21
Belarus Belarus 22.1 +11.3% 71
Belize Belize 31.4 -4.47% 58
Bolivia Bolivia 11 -53.1% 86
Brazil Brazil 58.5 +4.37% 24
Bhutan Bhutan 20 -23.4% 76
Botswana Botswana 229 +7.08% 4
Central African Republic Central African Republic 47 +27.4% 33
China China 143 +5.52% 6
Cameroon Cameroon 31.8 -6.28% 56
Congo - Kinshasa Congo - Kinshasa 46.1 +2.34% 35
Congo - Brazzaville Congo - Brazzaville 9.2 -13.5% 90
Colombia Colombia 29.9 -2.79% 62
Comoros Comoros 85 +8.51% 17
Cape Verde Cape Verde 34.2 +12.9% 51
Costa Rica Costa Rica 33.9 +53.2% 52
Djibouti Djibouti 14.6 -21.3% 83
Dominica Dominica 30.7 -10.1% 60
Dominican Republic Dominican Republic 29.8 -1.17% 63
Algeria Algeria 1,110 +10.2% 1
Ecuador Ecuador 7.33 -47.4% 95
Egypt Egypt 19.7 -0.161% 77
Ethiopia Ethiopia 6.09 +56.6% 97
Fiji Fiji 46.3 -11.2% 34
Gabon Gabon 19.1 +7.77% 78
Georgia Georgia 20.4 +0.342% 75
Ghana Ghana 8.28 -32.1% 94
Guinea Guinea 36.5 -15.1% 47
Gambia Gambia 43.5 -9.6% 37
Grenada Grenada 55.6 +4.61% 28
Guatemala Guatemala 84 +4% 18
Guyana Guyana 30.3 -31.6% 61
Honduras Honduras 58.8 -11.6% 23
Haiti Haiti 98.1 +15.6% 12
Indonesia Indonesia 36 +4.03% 48
India India 97.1 +5.31% 13
Iraq Iraq 552 +29.3% 2
Jamaica Jamaica 31.7 +10.9% 57
Jordan Jordan 42.7 -3.2% 38
Kazakhstan Kazakhstan 22 +1.16% 72
Kenya Kenya 17.1 -10.8% 80
Kyrgyzstan Kyrgyzstan 32 +11.4% 55
Cambodia Cambodia 88.7 +12% 15
Laos Laos 8.7 +5.55% 91
Lebanon Lebanon 41.5 -14.5% 39
St. Lucia St. Lucia 39.1 -8.71% 42
Sri Lanka Sri Lanka 7.14 +121% 96
Lesotho Lesotho 48.1 +12.8% 31
Morocco Morocco 52.4 +5.45% 29
Moldova Moldova 51.3 +11.4% 30
Madagascar Madagascar 40.8 +12.1% 40
Maldives Maldives 14.8 -29.2% 82
Mexico Mexico 36 +4.69% 49
North Macedonia North Macedonia 39.8 +12.3% 41
Myanmar (Burma) Myanmar (Burma) 76.8 +17.6% 20
Montenegro Montenegro 18.3 -21.8% 79
Mongolia Mongolia 14.3 +41% 84
Mozambique Mozambique 5.44 +19.2% 98
Mauritius Mauritius 37.6 -14.7% 46
Nigeria Nigeria 31.3 -9.38% 59
Nicaragua Nicaragua 35.9 +21.5% 50
Nepal Nepal 125 +23.1% 9
Pakistan Pakistan 10.5 +35% 88
Peru Peru 79.3 -2.65% 19
Philippines Philippines 85.5 -1.03% 16
Papua New Guinea Papua New Guinea 25.5 +25.4% 66
Paraguay Paraguay 37.8 -1.52% 44
Rwanda Rwanda 16.1 -9.53% 81
Solomon Islands Solomon Islands 130 -5.92% 8
Sierra Leone Sierra Leone 20.8 -20% 74
El Salvador El Salvador 13.5 +7.07% 85
Serbia Serbia 56.3 +21% 27
São Tomé & Príncipe São Tomé & Príncipe 10.2 -33.4% 89
Suriname Suriname 33.3 +16.8% 53
Eswatini Eswatini 38.6 +6.56% 43
Chad Chad 32.7 +7.04% 54
Thailand Thailand 116 +7.66% 10
Tajikistan Tajikistan 48.1 -16% 32
Timor-Leste Timor-Leste 254 -11.3% 3
Tonga Tonga 202 +12.8% 5
Tunisia Tunisia 22.4 +13.4% 70
Turkey Turkey 28.2 +0.247% 65
Ukraine Ukraine 22.9 +15.3% 68
Uzbekistan Uzbekistan 58.4 -20% 25
St. Vincent & Grenadines St. Vincent & Grenadines 44.6 -22.8% 36
Vietnam Vietnam 65 +10.2% 22
Vanuatu Vanuatu 137 -0.729% 7
Samoa Samoa 103 +51.5% 11
Kosovo Kosovo 29.4 -13.9% 64
South Africa South Africa 37.7 +6.9% 45
Zambia Zambia 10.9 +4.31% 87
Zimbabwe Zimbabwe 0.813 -81.2% 99

The indicator 'Total reserves (% of total external debt)' is a crucial measure in assessing a nation's financial health and stability in relation to its external obligations. This metric reflects the proportion of a country's reserves—including foreign currency and gold—compared to its total external debt. A higher percentage suggests that a country has a stronger backing to meet its external debt responsibilities, thus mitigating risks of insolvency or default. Conversely, a lower percentage may raise concerns regarding a country's ability to service its debts, especially during economic crises or financial downturns.

The importance of this indicator cannot be overstated; it provides insights into economic resilience, liquidity, and potential vulnerabilities. Nations with higher total reserves relative to their external debts are often viewed as more secure by investors, promoting stability in investment and lending markets. This can lead to lower borrowing costs and improved credit ratings, enhancing a country’s ability to finance infrastructure and social programs. Moreover, the indicator serves as a barometer for policymakers who aim to ensure economic growth without jeopardizing fiscal health.

This indicator relates closely to several other economic indicators, such as the current account balance, the debt-to-GDP ratio, and net international investment position. A strong current account balance is often associated with greater reserves since it indicates that a country is exporting more than it is importing, thereby accumulating foreign currency. Similarly, a lower debt-to-GDP ratio suggests that a country is managing its debt levels effectively, which can be supportive of robust reserve levels. The net international investment position, which measures a country’s financial assets versus liabilities, can indicate long-term sustainability, affecting perceptions regarding reserves and debt.

Several factors affect the 'Total reserves (% of total external debt)' indicator. For instance, fluctuations in global commodity prices can directly impact a country’s export revenues (especially for resource-dependent economies), thereby affecting its reserves. Political stability and effective governance are also crucial; countries experiencing political turmoil may see their investor confidence erode, resulting in lower reserves and higher external debt relative to those reserves. Economic policies, including monetary strategies to stabilize currency values, fiscal discipline to maintain budget surpluses, and trade policies to support export growth, are significant determinants of this ratio.

In 2023, the median value of this indicator across various countries was recorded at 35.96%. This figure indicates a significant capacity among the median countries to manage their external obligations, providing a benchmark for evaluating individual countries' performances. Moving beyond the averages, the top five areas in this category demonstrate remarkable resilience. Algeria leads the pack with a staggering 1110.24%, suggesting an exceptionally strong financial position where reserves vastly exceed total external debt. This could provide Algeria with a considerable safety net while engaging in international trade or investment. Following Algeria, Iraq's 552.02% and Timor-Leste's 254.4% also show robust reserve management. Botswana and Tonga, with reserves at 228.78% and 201.84% respectively, illustrate that these smaller economies have managed their reserves effectively relative to their external debt levels.

On the contrary, the bottom five areas paint a troubling picture. Zimbabwe, with a chilling 0.81%, exemplifies a scenario where the reserves are negligible compared to its total external debt. This severely limits the nation's ability to fulfill debt obligations and poses risks of default, reflecting a precarious economic landscape. Mozambique, Ecuador, Ghana, and Burundi similarly struggle, falling below 10%, indicating their vulnerable positions. These countries may face steep challenges in attracting international investment and may have limited policy options to address their economic difficulties.

Strategies to bolster the 'Total reserves (% of total external debt)' ratio include enhancing export diversification, promoting savings, and ensuring macroeconomic stability. Governments can implement policies that promote export-led growth, thus contributing to reserves accumulation. Additionally, encouraging domestic consumption of goods can lead to a reduction in foreign dependency, allowing local currency reserves to build up. Effective banking regulations can encourage savings and improve the financial system’s resilience to shocks.

Moreover, international cooperation and technical assistance from global financial institutions can aid countries in improving their reserve management strategies. Countries should focus on developing contingency plans to mitigate the risks associated with external economic shocks, ensuring adequate reserves are in place.

Despite its relevance, relying solely on the 'Total reserves (% of total external debt)' indicator has inherent flaws. It does not account for qualitative aspects of reserves—such as liquidity or the sustainability of external debts—or the potential impact of currency fluctuations on the value of reserves. Countries may present strong figures while actually facing significant underlying economic vulnerabilities that this metric does not capture.

In conclusion, while the 'Total reserves (% of total external debt)' indicator offers valuable insights into a country’s economic stability, it must be assessed in conjunction with other economic measures to fully understand a nation’s financial health. Both policymakers and investors should consider the broader economic context, qualitative factors, and patterns over time, rather than relying solely on this single metric for decision-making.

                    
# 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 = 'FI.RES.TOTL.DT.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 <- 'FI.RES.TOTL.DT.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))