Net migration

Source: worldbank.org, 01.09.2025

Year: 2024

Flag Country Value Value change, % Rank
Aruba Aruba 141 -4.08% 83
Afghanistan Afghanistan -44,089 -9.95% 193
Angola Angola -2,629 +164% 128
Albania Albania -24,472 -3.49% 176
Andorra Andorra 988 -6.88% 69
United Arab Emirates United Arab Emirates 278,439 -7.19% 6
Argentina Argentina 3,454 -16.4% 58
Armenia Armenia -29,966 -140% 184
American Samoa American Samoa -1,110 -4.23% 109
Antigua & Barbuda Antigua & Barbuda 9 87
Australia Australia 138,510 -1.23% 14
Austria Austria 8,813 +82.9% 47
Azerbaijan Azerbaijan 10,864 -113% 45
Burundi Burundi -27,074 -1,457% 179
Belgium Belgium 36,243 -13% 30
Benin Benin -7,725 +3,923% 146
Burkina Faso Burkina Faso -25,807 +3.41% 177
Bangladesh Bangladesh -473,362 -13.9% 211
Bulgaria Bulgaria 524 -89.9% 74
Bahrain Bahrain 22,699 +13.5% 36
Bahamas Bahamas 1,018 +1.7% 68
Bosnia & Herzegovina Bosnia & Herzegovina -4,497 +827% 136
Belarus Belarus -3,119 +2.8% 133
Belize Belize 490 -17.6% 76
Bermuda Bermuda -5 89
Bolivia Bolivia -3,000 -0.266% 132
Brazil Brazil -225,510 -6.06% 206
Barbados Barbados -70 -12.5% 94
Brunei Brunei 0 88
Bhutan Bhutan -277 -195% 98
Botswana Botswana -5,778 -10.9% 142
Central African Republic Central African Republic -15,357 +4.6% 163
Canada Canada 368,599 -15% 5
Switzerland Switzerland 40,099 -11.1% 27
Chile Chile 58,316 -6.96% 23
China China -318,992 -43.8% 209
Côte d’Ivoire Côte d’Ivoire 7,838 +30.6% 49
Cameroon Cameroon -13,892 +190% 160
Congo - Kinshasa Congo - Kinshasa -26,968 +79.9% 178
Congo - Brazzaville Congo - Brazzaville -2,491 +150% 126
Colombia Colombia 141,643 -8.33% 13
Comoros Comoros -2,051 +2.45% 120
Cape Verde Cape Verde -1,209 -1.39% 111
Costa Rica Costa Rica 967 -2.81% 70
Cuba Cuba -22,356 -1.93% 173
Curaçao Curaçao 513 -0.965% 75
Cayman Islands Cayman Islands 896 -2.71% 71
Cyprus Cyprus 8,138 -6.43% 48
Czechia Czechia -86,169 +489% 198
Germany Germany 36,954 -93.9% 29
Djibouti Djibouti -11 -102% 91
Dominica Dominica -200 +0.503% 97
Denmark Denmark 25,639 -17.3% 34
Dominican Republic Dominican Republic -34,806 -0.312% 188
Algeria Algeria -31,240 +20.3% 185
Ecuador Ecuador -19,704 -10.2% 168
Egypt Egypt 123,884 -59.4% 15
Eritrea Eritrea -12,696 -16.9% 158
Spain Spain 111,674 -6.23% 18
Estonia Estonia -7,742 -235% 147
Ethiopia Ethiopia 30,069 -351% 31
Finland Finland 26,894 -29.5% 32
Fiji Fiji -3,278 -0.334% 134
France France 90,527 -1.45% 20
Faroe Islands Faroe Islands 488 -18.5% 77
Micronesia (Federated States of) Micronesia (Federated States of) -1,104 -2.65% 108
Gabon Gabon 1,105 +12% 67
United Kingdom United Kingdom 417,114 -6.38% 4
Georgia Georgia 1,745 -12.9% 63
Ghana Ghana -13,114 +31.1% 159
Gibraltar Gibraltar 598 -13.2% 72
Guinea Guinea -12,024 +201% 156
Gambia Gambia -2,989 -0.367% 131
Guinea-Bissau Guinea-Bissau -1,712 +22.3% 117
Equatorial Guinea Equatorial Guinea 3,891 -2.65% 55
Greece Greece -122,772 -23% 202
Grenada Grenada -192 +1.05% 96
Greenland Greenland -284 -10.7% 100
Guatemala Guatemala -7,725 -13.6% 146
Guam Guam -504 +0.8% 103
Guyana Guyana -5,407 -12.2% 140
Hong Kong SAR China Hong Kong SAR China -19,272 +462% 167
Honduras Honduras -4,821 -4.42% 137
Croatia Croatia -5,186 -151% 139
Haiti Haiti -31,747 -0.123% 186
Hungary Hungary 16,223 -67% 41
Indonesia Indonesia -38,469 +2.58% 191
Isle of Man Isle of Man 177 -9.69% 81
India India -630,830 -35.6% 213
Ireland Ireland 39,059 -11% 28
Iran Iran 190,156 -27.4% 8
Iraq Iraq -17,735 +211% 166
Iceland Iceland 3,543 -23.5% 57
Israel Israel 10,612 +6.13% 46
Italy Italy 95,246 -36.6% 19
Jamaica Jamaica -10,506 +5.03% 154
Jordan Jordan -156,369 +796% 203
Japan Japan 153,357 -12.4% 12
Kazakhstan Kazakhstan -7,368 +52.8% 145
Kenya Kenya -19,781 +97.8% 169
Kyrgyzstan Kyrgyzstan 3,645 -34.9% 56
Cambodia Cambodia -32,960 +3.53% 187
Kiribati Kiribati -471 -2.89% 102
St. Kitts & Nevis St. Kitts & Nevis -7 90
South Korea South Korea 75,963 -13.5% 21
Kuwait Kuwait 61,624 +23.2% 22
Laos Laos -10,284 +2.81% 151
Lebanon Lebanon -17,267 -49.5% 165
Liberia Liberia -7,779 +55.5% 148
Libya Libya 3,448 -272% 59
St. Lucia St. Lucia -7 90
Liechtenstein Liechtenstein 206 -3.74% 80
Sri Lanka Sri Lanka -27,245 -2.73% 181
Lesotho Lesotho -5,107 -1.18% 138
Lithuania Lithuania 2,617 -94.2% 61
Luxembourg Luxembourg 5,677 -3.86% 53
Latvia Latvia -2,225 -128% 123
Macao SAR China Macao SAR China 1,620 -81.6% 64
Saint Martin (French part) Saint Martin (French part) -1,424 -16.1% 114
Morocco Morocco -46,802 +18% 194
Monaco Monaco 110 +25% 84
Moldova Moldova -27,088 +45.9% 180
Madagascar Madagascar -1,795 +20.7% 119
Maldives Maldives -2,421 -15.8% 124
Mexico Mexico -104,581 +3.5% 199
Marshall Islands Marshall Islands -1,765 -3.66% 118
North Macedonia North Macedonia -5,728 +2.34% 141
Mali Mali -46,880 +17.3% 195
Malta Malta 6,323 -4.07% 52
Myanmar (Burma) Myanmar (Burma) -37,979 +8.55% 190
Montenegro Montenegro -1,686 -114% 116
Mongolia Mongolia 83 85
Northern Mariana Islands Northern Mariana Islands -1,097 -17% 107
Mozambique Mozambique -38,940 +7.34% 192
Mauritania Mauritania -2,185 -173% 122
Mauritius Mauritius -2,787 -1.31% 130
Malawi Malawi -1,507 -74.1% 115
Malaysia Malaysia 174,770 -3.48% 9
Namibia Namibia 4,211 -63.9% 54
New Caledonia New Caledonia 455 -6.19% 78
Niger Niger -4,041 -506% 135
Nigeria Nigeria -35,202 -39.2% 189
Nicaragua Nicaragua -8,189 +2.41% 150
Netherlands Netherlands 121,628 -15.9% 17
Norway Norway 44,356 -17.6% 26
Nepal Nepal -401,282 -2.07% 210
Nauru Nauru -121 -18.2% 95
New Zealand New Zealand 18,766 -12.3% 39
Oman Oman 154,219 -1.32% 11
Pakistan Pakistan -1,401,173 -13.5% 214
Panama Panama 6,706 -7.66% 51
Peru Peru 18,406 -25.7% 40
Philippines Philippines -160,373 -2.38% 204
Palau Palau -14 -26.3% 92
Papua New Guinea Papua New Guinea -707 -10.2% 105
Poland Poland -238,062 +2,943% 207
Puerto Rico Puerto Rico 11,561 -41.7% 44
North Korea North Korea -2,473 +23.8% 125
Portugal Portugal 20,648 -29% 37
Paraguay Paraguay -12,451 -0.392% 157
Palestinian Territories Palestinian Territories -23,145 -7.41% 175
French Polynesia French Polynesia -1,261 -6.45% 112
Qatar Qatar 46,105 +15.3% 25
Romania Romania -28,466 +2.47% 182
Russia Russia -178,042 -740% 205
Rwanda Rwanda -15,582 +73.1% 164
Saudi Arabia Saudi Arabia 122,170 -62.5% 16
Sudan Sudan -544,257 -59.7% 212
Senegal Senegal -10,307 +3.08% 152
Singapore Singapore 20,011 -25.9% 38
Solomon Islands Solomon Islands 1,610 -1.59% 65
Sierra Leone Sierra Leone -11,000 +175% 155
El Salvador El Salvador -23,102 -0.649% 174
San Marino San Marino 37 -119% 86
Somalia Somalia 26,859 -41.9% 33
Serbia Serbia -8,132 -287% 149
South Sudan South Sudan 15,374 -96.6% 42
São Tomé & Príncipe São Tomé & Príncipe -604 +2.03% 104
Suriname Suriname -1,166 +18% 110
Slovakia Slovakia -21,027 -526% 170
Slovenia Slovenia 3,319 -37.8% 60
Sweden Sweden 50,115 -9.23% 24
Eswatini Eswatini -6,754 -21% 143
Sint Maarten Sint Maarten 558 -1.59% 73
Seychelles Seychelles 1,747 -3.43% 62
Syria Syria 546,494 -27.8% 3
Turks & Caicos Islands Turks & Caicos Islands 176 -8.81% 82
Chad Chad 204,040 -58.9% 7
Togo Togo -14,014 +602% 161
Thailand Thailand 23,321 +18.7% 35
Tajikistan Tajikistan -21,236 +6.19% 171
Turkmenistan Turkmenistan 14,646 -2.39% 43
Timor-Leste Timor-Leste -2,552 -54.6% 127
Tonga Tonga -2,149 -1.1% 121
Trinidad & Tobago Trinidad & Tobago 1,334 -37.3% 66
Tunisia Tunisia -15,221 +8.71% 162
Turkey Turkey -275,952 -13.2% 208
Tuvalu Tuvalu -280 -13.3% 99
Tanzania Tanzania -29,865 -24.2% 183
Uganda Uganda -117,924 -6.54% 201
Ukraine Ukraine 1,146,012 -482% 2
Uruguay Uruguay -1,348 -10.2% 113
United States United States 1,286,132 -2.76% 1
Uzbekistan Uzbekistan -7,066 +17.7% 144
St. Vincent & Grenadines St. Vincent & Grenadines -737 -5.99% 106
Venezuela Venezuela -105,297 -6.73% 200
British Virgin Islands British Virgin Islands 212 -63.9% 79
U.S. Virgin Islands U.S. Virgin Islands -420 -5.41% 101
Vietnam Vietnam -59,645 -27.1% 196
Vanuatu Vanuatu -43 93
Samoa Samoa -2,754 -1.99% 129
Kosovo Kosovo -22,178 -22.9% 172
Yemen Yemen -10,482 +100% 153
South Africa South Africa 166,972 -26.8% 10
Zambia Zambia 7,381 -22.5% 50
Zimbabwe Zimbabwe -60,528 -37.8% 197

Net migration is a demographic indicator that measures the difference between the number of immigrants and emigrants in a given area over a specific period. This metric can provide significant insights into population trends, social dynamics, and economic conditions in various regions globally. Understanding net migration is crucial as it not only reflects the movement of people but also encapsulates broader issues such as economic opportunity, social stability, and environmental factors.

The importance of net migration cannot be overstated. In regions experiencing population decline, positive net migration can serve as a lifeline, bringing in fresh talent, labor, and cultural diversity. On the other hand, areas with negative net migration often face challenges such as labor shortages, declining consumer bases, and potential economic stagnation. The relationship of net migration to other indicators, such as GDP growth, unemployment rates, and birth/death rates, is complex but essential. Positive net migration typically aligns with higher economic growth and lower unemployment, as newcomers often fill critical jobs that support local economies.

Factors affecting net migration are multifaceted and can vary significantly depending on the region. Economic opportunities, political stability, educational prospects, and the quality of life in a destination country can attract migrants. Conversely, conflict, persecution, and economic downturns in a home country can drive people to seek refuge elsewhere. For example, the data from the latest year, 2023, reflects a median net migration value of -318.0, indicating a net loss in the global population when averaged. This suggests a transition in migration trends, possibly influenced by worsening conditions in countries typically associated with emigration.

In examining the top five areas for net migration, the data reveals that the United States leads with a net migration of 1,322,668 individuals, followed by Syria (757,309), Germany (609,553), Chad (496,830), and South Sudan (455,000). The United States has long been a destination for migrants due to its diverse economy, educational opportunities, and established immigrant communities. Meanwhile, Syria’s high net migration number may be attributed to ongoing conflicts that have forced many to flee in search of safety. Germany's strong economy and social welfare system attract international talent, while Chad and South Sudan's figures may reflect regional dynamics and humanitarian crises prompting migration.

On the contrary, the bottom five areas indicate countries that are experiencing significant net emigration. Pakistan (-1,619,557), Sudan (-1,349,998), India (-979,179), China (-567,724), and Bangladesh (-549,918) are all facing challenges that encourage outflow. Pakistan and Sudan are grappling with political instability and economic issues, while India’s significant net migration could be tied to a combination of economic opportunities abroad and educational aspirations. China's figure may reflect a trend where individuals seek better job opportunities or living conditions outside of their home country. Similarly, economic migration patterns in Bangladesh reveal a struggle for many to overcome poverty and lack of opportunities at home.

The global trend observed since 1960, with a striking value of zero for net migration annually until 2023, illustrates a time of relative stability in global population movement compared to the recent surges of migration driven by various crises. This stark contrast indicates a significant shift in how migration is perceived and addressed globally. Strategies for managing and enhancing positive net migration often include policies aimed at attracting skilled labor, creating inclusive immigration laws, and fostering a welcoming environment for newcomers. Addressing the underlying issues that lead to emigration, such as conflict resolution and economic development, is also critical in maintaining healthy population levels.

Despite the advantages of net migration, flaws do exist. One of the foremost issues is the potential for social tension and conflict arising from rapid demographic changes. Host communities may face challenges in integrating large influxes of migrants, leading to cultural friction and resource strain. Moreover, overly restrictive immigration policies can exacerbate the problem by forcing individuals to undertake dangerous journeys or fall victim to trafficking and exploitation.

In conclusion, net migration is a crucial indicator that intertwines with various social, economic, and political factors, impacting individual lives and shaping nations worldwide. The global landscape of migration is ever-changing and requires thoughtful consideration of the driving forces behind it, the consequences for local and global economies, and the strategies needed to support both migrants and host communities effectively. Only through comprehensive understanding and proactive policies can the benefits of migration be maximized while minimizing potential downsides.

                    
# 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 = 'SM.POP.NETM'

# 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 <- 'SM.POP.NETM'

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