Foreign direct investment, net inflows (% of GDP)

Source: worldbank.org, 03.09.2025

Year: 2024

Flag Country Value Value change, % Rank
Angola Angola -0.169 -93.2% 96
Albania Albania 6.31 -8.37% 17
Argentina Argentina 1.81 -51.1% 61
Armenia Armenia 0.537 -77.7% 84
Antigua & Barbuda Antigua & Barbuda 12.2 -25.6% 8
Australia Australia 3.15 +67.7% 39
Austria Austria 1.78 +212% 62
Azerbaijan Azerbaijan 0.311 -10.9% 89
Belgium Belgium -5.35 +1,143% 104
Bangladesh Bangladesh 0.335 +5.68% 88
Bulgaria Bulgaria 3.12 -42.7% 40
Bahrain Bahrain 5.66 -63.8% 18
Bahamas Bahamas 1.52 -28% 68
Bosnia & Herzegovina Bosnia & Herzegovina 3.98 +6.01% 28
Belarus Belarus 2.27 -17.3% 50
Belize Belize 3.64 +596% 34
Brazil Brazil 3.26 +14.4% 38
Brunei Brunei 0.188 -151% 91
Canada Canada 2.77 +43.2% 43
Switzerland Switzerland -12 +20.4% 106
Chile Chile 3.79 -30.8% 30
China China 0.099 -64.8% 94
Colombia Colombia 3.4 -25.8% 37
Cape Verde Cape Verde 3.89 -37.8% 29
Costa Rica Costa Rica 5.53 +2.13% 19
Czechia Czechia 3.78 +9.17% 31
Germany Germany 1.02 -40.3% 73
Djibouti Djibouti 1.66 -52.6% 65
Dominica Dominica 5.34 -26% 20
Denmark Denmark 4.21 +275% 26
Dominican Republic Dominican Republic 3.6 -8.68% 35
Ecuador Ecuador 0.186 -52.5% 92
Spain Spain 1.89 -28.7% 58
Estonia Estonia -8.18 -163% 105
Finland Finland 0.661 -671% 81
France France 1.75 +508% 63
United Kingdom United Kingdom 0.0962 -76.5% 95
Georgia Georgia 4.05 -40.3% 27
Gambia Gambia 9.27 +8.02% 11
Greece Greece 2.51 +29.4% 47
Grenada Grenada 16.2 -2.37% 4
Guatemala Guatemala 1.61 +2.13% 66
Hong Kong SAR China Hong Kong SAR China 28.7 -10.2% 2
Honduras Honduras 3.53 +11.6% 36
Croatia Croatia 5.04 +27.3% 21
Hungary Hungary -14.7 -55.6% 107
Indonesia Indonesia 1.73 +9.99% 64
India India 0.706 -8.56% 79
Iceland Iceland 1.56 -69.9% 67
Israel Israel 3.11 -1.26% 41
Italy Italy 0.918 -49.7% 74
Jamaica Jamaica 0.826 -57.4% 78
Japan Japan 0.427 -10.9% 85
Kazakhstan Kazakhstan -0.236 -111% 97
Cambodia Cambodia 9.48 +1.39% 10
St. Kitts & Nevis St. Kitts & Nevis 2.05 -29.9% 52
Kuwait Kuwait 0.384 -70% 86
St. Lucia St. Lucia 7.04 +38.6% 13
Lesotho Lesotho -0.551 -54.5% 99
Lithuania Lithuania 4.24 -11.8% 24
Latvia Latvia 2.96 -25.4% 42
Moldova Moldova 1.83 -14.3% 60
Maldives Maldives 11.6 -0.658% 9
Mexico Mexico 2.37 +38.6% 49
North Macedonia North Macedonia 7.03 +72.7% 14
Malta Malta 175 +54.4% 1
Montenegro Montenegro 7.41 +6.14% 12
Mozambique Mozambique 15.7 +22.2% 5
Malaysia Malaysia 3.7 +86.5% 33
Namibia Namibia 15.4 -16.7% 6
Nigeria Nigeria 0.575 +11.8% 83
Nicaragua Nicaragua 6.87 +9.76% 15
Netherlands Netherlands -1.1 -95.9% 101
Norway Norway 0.85 -70.2% 77
Nepal Nepal 0.169 -7.04% 93
New Zealand New Zealand 1.21 -14.1% 71
Pakistan Pakistan 0.688 +13.6% 80
Panama Panama 3.76 +31.1% 32
Philippines Philippines 1.93 -5.27% 56
Poland Poland 2.02 -52.2% 53
Portugal Portugal 4.27 +8.15% 23
Paraguay Paraguay 0.9 -32.7% 75
Palestinian Territories Palestinian Territories 1.18 +104% 72
Qatar Qatar 0.211 -195% 90
Romania Romania 1.92 -22.6% 57
Russia Russia -0.376 -22.4% 98
Saudi Arabia Saudi Arabia 1.27 -32% 70
Singapore Singapore 27.8 +5.89% 3
Solomon Islands Solomon Islands 1.87 -60.6% 59
El Salvador El Salvador 2.61 +37.5% 45
Suriname Suriname -0.797 -48.2% 100
Slovakia Slovakia 2.53 -1,132% 46
Slovenia Slovenia 2.69 +28.6% 44
Sweden Sweden 4.37 +42.2% 22
Thailand Thailand 1.94 +53.9% 55
Tajikistan Tajikistan 2.05 +78.6% 51
Timor-Leste Timor-Leste 12.3 +305% 7
Trinidad & Tobago Trinidad & Tobago -3.94 -35.5% 103
Turkey Turkey 0.851 -10.7% 76
Ukraine Ukraine 1.99 -21.1% 54
Uruguay Uruguay -3.14 -54.4% 102
United States United States 1.33 +5.66% 69
Uzbekistan Uzbekistan 2.47 +17.4% 48
St. Vincent & Grenadines St. Vincent & Grenadines 6.37 -7.64% 16
Vietnam Vietnam 4.23 -0.707% 25
Samoa Samoa 0.35 +37.2% 87
South Africa South Africa 0.606 -33% 82

Foreign direct investment (FDI), net inflows as a percentage of GDP, is an essential metric for understanding the economic integration of countries and how much foreign capital is being invested in local economies relative to their size. FDI represents investments made by entities in one country into businesses or assets in another, and net inflows capture the total amount received from foreign investments minus outflows from domestic investments abroad.

The importance of FDI cannot be overstated as it serves as a vital source of external capital for developing countries and helps in economic development. It can create job opportunities, enhance productivity, and facilitate technology transfer, thereby boosting economic growth. Moreover, positive foreign investment can lead to improved infrastructure, better education systems, and stronger governance

.

FDI's relationship with other economic indicators is multifaceted. For instance, high levels of FDI often correlate with increased GDP growth rates, improved trade balances, and elevated employment levels. It can also influence and be influenced by other variables such as political stability, economic policies, and investment climates. The degree of openness of an economy towards foreign investments can also impact its FDI levels; countries that offer favorable tax regimes, stable regulations, and robust legal frameworks usually attract more foreign capital.

Several factors affect FDI inflows, chief among them are macroeconomic stability, market size, and potential growth. Political stability and government policy play significant roles, as investors seek assurance that their investments will be protected. Furthermore, infrastructure quality, human capital, and ease of doing business are critical considerations for foreign investors. Countries endowed with these attributes typically enjoy higher FDI levels than their less-equipped counterparts.

Strategies to increase FDI can involve simplifying bureaucratic processes, streamlining permit applications, enhancing investor protection laws, and improving infrastructure. Countries can also engage in international trade agreements and promote economic zones to entice foreign investors. Additionally, proactive government policies that support research and innovation can foster an appealing environment for potential investors.

However, there are inherent flaws and challenges associated with an over-reliance on FDI. First, an influx of foreign investment can sometimes lead to adverse national situations, such as the crowding out of local businesses. There may also be the risk of capital flight, where profits are repatriated back to the investor's home country, limiting the domestic economic benefits of the investment. Moreover, unchecked foreign investments can result in environmental degradation or contribute to socio-economic inequalities, particularly when multinationals prioritize profit over local welfare.

The data for 2023 concerning FDI highlights intriguing insights. The median value for FDI, net inflows as a percentage of GDP stands at 1.71%. Among the top five areas attracting FDI, the Cayman Islands leads dramatically with a staggering 286.04%, signaling a significant influx of international capital likely drawn by favorable tax regulations and the financial services sector. Malta follows with 112.63%, also reflecting a robust financial services sector complemented by tourism and other industries, contributing heavily to its economy.

Singapore also shows strong performance at 34.95%, underscoring its status as a global business hub with efficient regulatory frameworks and strategic location in Southeast Asia. Hong Kong SAR, China at 29.18%, benefits from its reputation as a leading financial center and gateway to mainland China. Namibia, with 18.58%, illustrates potential growth within developing regions, likely due to its mineral resources and a relatively open investment environment.

In contrast, the bottom five regions present a stark contrast, illustrating negative FDI inflows. Hungary at -34.01%, Luxembourg at -27.61%, and the Netherlands at -26.77% reveal a concerning trend of capital outflows possibly due to political uncertainties or unfavorable investment climates. Cyprus and Ireland follow with -26.39% and -25.39% respectively, indicating challenges that may arise from economic policies or withdrawal of multinational enterprises.

Tracing the global values, the evolution of FDI from 1970 to 2023 showcases significant fluctuations, with historic peaks noted around 2000 when FDI inflows reached as high as 4.54%. However, the trend post-2008 shows a gradual decline to a level of 0.78% by 2023. The decline could be attributed to a series of global economic challenges, including the fallout from the 2008 financial crisis and the subsequent shifts in foreign investment strategies.

Understanding FDI, net inflows as a percentage of GDP, is paramount for policymakers seeking to optimize economic growth strategies and to balance foreign investment with national interests. The interplay of various factors, including global economic conditions, local investment climates, and regulatory frameworks, will continue to shape the context and direction of foreign investment into the foreseeable future.

                    
# 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 = 'BX.KLT.DINV.WD.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 <- 'BX.KLT.DINV.WD.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))