Short-term debt (% of total external debt)

Source: worldbank.org, 03.09.2025

Year: 2023

Flag Country Value Value change, % Rank
Afghanistan Afghanistan 12.4 +7.2% 45
Angola Angola 8.65 +24.6% 60
Albania Albania 11 -10.4% 54
Argentina Argentina 20.6 +11% 21
Armenia Armenia 19.6 -3.61% 23
Azerbaijan Azerbaijan 4.21 +27.1% 85
Burundi Burundi 0.0281 +1.44% 114
Benin Benin 15.1 +6.82% 32
Burkina Faso Burkina Faso 0 118
Bangladesh Bangladesh 14 -26.6% 36
Bosnia & Herzegovina Bosnia & Herzegovina 20.6 +4.92% 22
Belarus Belarus 28.3 +11.1% 9
Belize Belize 0.765 +14.3% 103
Bolivia Bolivia 4.86 +22.8% 81
Brazil Brazil 13.3 +13.4% 41
Bhutan Bhutan 0.0282 -83.8% 113
Botswana Botswana 14 +150% 37
Central African Republic Central African Republic 7.24 -28.2% 67
China China 53.2 +2.93% 1
Côte d’Ivoire Côte d’Ivoire 8.16 +53.9% 62
Cameroon Cameroon 5.6 -3.76% 77
Congo - Kinshasa Congo - Kinshasa 5.44 -10.1% 79
Congo - Brazzaville Congo - Brazzaville 2.54 +3.45% 91
Colombia Colombia 10.1 -3.95% 58
Comoros Comoros 0.119 -72.5% 112
Cape Verde Cape Verde 16.6 -0.297% 30
Costa Rica Costa Rica 13.9 -21.2% 39
Djibouti Djibouti 14 -29.6% 38
Dominica Dominica 29.6 -10.6% 8
Dominican Republic Dominican Republic 7.59 +15.6% 65
Algeria Algeria 26.1 +6.88% 12
Ecuador Ecuador 2.87 -9.36% 90
Egypt Egypt 17.5 -5.41% 27
Eritrea Eritrea 6.04 +8.77% 74
Ethiopia Ethiopia 0.646 -41.5% 105
Fiji Fiji 23.7 +39.3% 17
Gabon Gabon 1.63 -59.7% 98
Georgia Georgia 17 +7.23% 29
Ghana Ghana 8.59 -21.2% 61
Guinea Guinea 5.76 +14.5% 75
Gambia Gambia 6.89 +101% 69
Guinea-Bissau Guinea-Bissau 0.131 +5.32% 110
Grenada Grenada 7.6 -17.7% 64
Guatemala Guatemala 0.325 -72.8% 108
Guyana Guyana 2.04 -22.2% 94
Honduras Honduras 10.7 +36.8% 55
Haiti Haiti 0.0033 -2.94% 116
Indonesia Indonesia 13.4 +10.9% 40
India India 19.5 -5.99% 24
Iran Iran 23.1 +15.6% 18
Iraq Iraq 4.78 -6.01% 83
Jamaica Jamaica 17.1 +21.8% 28
Jordan Jordan 35.8 -6.47% 3
Kazakhstan Kazakhstan 11.8 +16% 48
Kenya Kenya 6.56 +6.46% 73
Kyrgyzstan Kyrgyzstan 11.1 +11.5% 53
Cambodia Cambodia 19.4 -5.4% 25
Laos Laos 0.689 -82.4% 104
Lebanon Lebanon 25.9 +11.8% 13
Liberia Liberia 0.0038 115
St. Lucia St. Lucia 7.4 -31% 66
Sri Lanka Sri Lanka 11.7 -19.7% 49
Lesotho Lesotho 0.19 -76.3% 109
Morocco Morocco 14.5 -5.54% 33
Moldova Moldova 26.5 +5.4% 11
Madagascar Madagascar 1.99 -34.2% 96
Maldives Maldives 2.46 -78.2% 93
Mexico Mexico 10.1 +7.88% 57
North Macedonia North Macedonia 25 -6.41% 15
Mali Mali 1.01 +20% 101
Myanmar (Burma) Myanmar (Burma) 0.366 +44.3% 107
Montenegro Montenegro 2.02 -17.1% 95
Mongolia Mongolia 5.57 -2.74% 78
Mozambique Mozambique 1.4 +14.5% 99
Mauritania Mauritania 5.61 +24.6% 76
Mauritius Mauritius 49.1 +3.84% 2
Malawi Malawi 0.382 -85.9% 106
Niger Niger 0.774 -1.17% 102
Nigeria Nigeria 18.5 -11.3% 26
Nicaragua Nicaragua 6.79 -11.5% 70
Nepal Nepal 4.19 +19.5% 86
Pakistan Pakistan 6.79 -1.18% 71
Peru Peru 14.2 +19.5% 34
Philippines Philippines 14.1 -5.75% 35
Papua New Guinea Papua New Guinea 0.122 -99.2% 111
Paraguay Paraguay 10.6 +13.1% 56
Rwanda Rwanda 3.89 +0.227% 87
Sudan Sudan 21.3 -0.431% 20
Senegal Senegal 12.2 +8.41% 46
Solomon Islands Solomon Islands 7.73 -37.8% 63
Sierra Leone Sierra Leone 6.59 -2.12% 72
El Salvador El Salvador 12.8 +15.2% 42
Somalia Somalia 21.5 -22.2% 19
Serbia Serbia 1.98 -65.6% 97
São Tomé & Príncipe São Tomé & Príncipe 4.86 -0.0391% 82
Suriname Suriname 5.08 -48.3% 80
Eswatini Eswatini 4.57 +377% 84
Syria Syria 12.8 +0.351% 43
Chad Chad 1.08 +4.27% 100
Togo Togo 2.97 -43.7% 89
Thailand Thailand 35 +3.02% 4
Tajikistan Tajikistan 9.86 +6.02% 59
Turkmenistan Turkmenistan 0 -100% 118
Timor-Leste Timor-Leste 3.04 +2,506% 88
Tonga Tonga 0 118
Tunisia Tunisia 33.4 -0.0309% 7
Turkey Turkey 34.8 +7.29% 5
Tanzania Tanzania 12.7 -10.8% 44
Uganda Uganda 2.5 -70.4% 92
Ukraine Ukraine 11.9 +5.4% 47
Uzbekistan Uzbekistan 11.5 -10.1% 51
St. Vincent & Grenadines St. Vincent & Grenadines 0.0001 0% 117
Vietnam Vietnam 24.8 -4.88% 16
Vanuatu Vanuatu 11.2 +62.8% 52
Samoa Samoa 15.4 +1.39% 31
Kosovo Kosovo 34.3 +0.253% 6
Yemen Yemen 7.11 +4.64% 68
South Africa South Africa 25.5 +1.82% 14
Zambia Zambia 11.6 +25% 50
Zimbabwe Zimbabwe 27.7 -3.74% 10

The indicator 'Short-term debt (% of total external debt)' is a critical measure that reflects the financial vulnerability of a nation. It quantifies the proportion of a country's external debt that is due within a year. This metric is particularly important because it highlights the immediate repayment obligations of a country and provides insights into its liquidity risk, potential refinancing challenges, and overall financial health.

Understanding the significance of short-term debt is paramount for policymakers, investors, and economists. A high percentage of short-term debt in relation to total external debt can signal greater risk, as countries with more immediate obligations are more susceptible to external shocks, fluctuations in exchange rates, or changes in investor sentiment. Conversely, a low percentage indicates a more sustainable long-term debt structure, often associated with reduced refinancing risks.

In 2023, the median value for short-term debt as a proportion of total external debt stood at 8.62%. This figure provides a useful benchmark for assessing the financial position of nations worldwide. When analyzing the data, the countries with the highest levels of short-term debt relative to their total external obligations comprise a concerning list. Leading the pack is China with a staggering 53.19%. This figure raises certain questions regarding China’s short-term financing needs and may indicate a dependence on rolling over short-term debt which can be risky in periods of financial uncertainty.

Following China, Mauritius, Jordan, Thailand, and Turkey exhibit substantial short-term debt ratios, ranging from approximately 35% to 49%. These high percentages suggest that these nations may face significant refinancing risks, particularly if external conditions worsen or if interest rates rise. Factors such as exchange rate volatility and economic slowdown can exacerbate these challenges, potentially leading to financial distress.

On the flip side, the bottom five areas, which include Burkina Faso, Tonga, Turkmenistan, St. Vincent & Grenadines, and Haiti, all show minimal short-term debt proportions — some with figures as low as 0%. This could indicate either a strong reliance on long-term financing options or simply a lack of available external debt. While low levels of short-term debt can reflect stability, they may also raise concerns about a country's overall access to capital markets and financing options.

Despite its importance, measuring short-term debt alone could overlook broader financial indicators. It is crucial to relate this metric to other financial statistics, such as total external debt, debt service ratios, and the current account balance. These relationships can create a more nuanced picture of a nation’s financial health. For instance, a country with high short-term debt might appear vulnerable, but if it also has strong export performance, solid foreign reserves, and positive growth projections, its capacity to manage that debt may be enhanced.

Several factors influence the ratio of short-term debt to total external debt. Economic policies, interest rates, exchange rate stability, and overall fiscal health play critical roles. Nations experiencing rapid economic growth might lean towards short-term borrowing to capitalize on immediate investment opportunities, yet they must balance that against potential risks. Additionally, global financial conditions, such as interest rate increases by the Federal Reserve or fluctuations in oil prices, can heavily influence refinancing abilities and risk perceptions in these countries.

Strategically, countries can manage their short-term debt ratios by implementing prudent fiscal policies and ensuring a diversified borrowing strategy. This may involve refinancing short-term obligations before they mature or engaging in longer-term debt instruments where feasible. Countries could also focus on strengthening their foreign exchange reserves, which can serve as a buffer in times of financial stress.

One might consider solutions within the realm of international financial assistance. By working closely with multilateral development banks, countries can secure favorable terms for their existing debts. Moreover, improving economic fundamentals can enhance investor confidence, lower borrowing costs, and potentially decrease the reliance on short-term borrowing. Countries that enhance their financial transparency and policy predictability often attract foreign investment, which can lead to a more favorable debt composition.

However, the reliance on short-term debt can present flaws. For instance, when external conditions change unfavorably, countries with significant short-term liabilities may face immediate financial challenges that threaten economic stability. The balance between maintaining adequate levels of short-term debt for liquidity while ensuring long-term sustainability is delicate and requires constant monitoring, as economic environments can shift rapidly.

In conclusion, the 'Short-term debt (% of total external debt)' indicator remains a fundamental aspect of analyzing the financial health of countries. With a median value of 8.62% in 2023, the trends among countries underline essential lessons about risk management, the importance of robust economic fundamentals, and the need for strategic borrowing practices. By carefully evaluating and managing this metric in relation to broader economic indicators—while being mindful of the risks associated with high short-term debt—nations can enhance their resilience to financial shocks and cultivate a more stable economic environment.

                    
# 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 = 'DT.DOD.DSTC.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 <- 'DT.DOD.DSTC.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))