Urban population

Source: worldbank.org, 01.09.2025

Year: 2024

Flag Country Value Value change, % Rank
Aruba Aruba 47,865 +0.745% 192
Afghanistan Afghanistan 11,627,839 +4.15% 60
Angola Angola 26,247,695 +3.98% 36
Albania Albania 1,774,817 +0.0472% 139
Andorra Andorra 71,898 +1.31% 186
United Arab Emirates United Arab Emirates 9,572,613 +4.02% 67
Argentina Argentina 42,305,047 +0.472% 23
Armenia Armenia 1,939,286 +2.64% 136
American Samoa American Samoa 40,818 -1.54% 197
Antigua & Barbuda Antigua & Barbuda 22,822 +0.511% 208
Australia Australia 23,600,172 +2.23% 40
Austria Austria 5,490,476 +1% 91
Azerbaijan Azerbaijan 5,917,347 +1.21% 89
Burundi Burundi 2,129,644 +5.23% 134
Belgium Belgium 11,665,911 +0.795% 59
Benin Benin 7,328,118 +3.66% 80
Burkina Faso Burkina Faso 7,810,189 +4.3% 77
Bangladesh Bangladesh 71,559,763 +3.12% 11
Bulgaria Bulgaria 4,964,546 +0.403% 97
Bahrain Bahrain 1,429,787 +0.882% 145
Bahamas Bahamas 336,131 +0.628% 169
Bosnia & Herzegovina Bosnia & Herzegovina 1,604,529 +0.214% 142
Belarus Belarus 7,409,724 -0.000108% 79
Belize Belize 195,348 +1.95% 176
Bermuda Bermuda 64,636 -0.0958% 188
Bolivia Bolivia 8,881,106 +1.89% 72
Brazil Brazil 186,592,664 +0.667% 4
Barbados Barbados 89,113 +0.438% 182
Brunei Brunei 367,581 +1.19% 166
Bhutan Bhutan 356,186 +2.13% 168
Botswana Botswana 1,852,785 +2.52% 137
Central African Republic Central African Republic 2,352,433 +4.68% 130
Canada Canada 33,848,393 +3.15% 29
Switzerland Switzerland 6,714,777 +1.81% 84
Chile Chile 17,415,926 +0.658% 47
China China 923,498,574 +1.38% 1
Côte d’Ivoire Côte d’Ivoire 17,130,798 +3.42% 48
Cameroon Cameroon 17,442,793 +3.65% 46
Congo - Kinshasa Congo - Kinshasa 52,512,709 +4.63% 18
Congo - Brazzaville Congo - Brazzaville 4,410,147 +3.09% 105
Colombia Colombia 43,711,637 +1.45% 21
Comoros Comoros 263,611 +2.88% 171
Cape Verde Cape Verde 359,079 +1.12% 167
Costa Rica Costa Rica 4,266,392 +1.14% 108
Cuba Cuba 8,526,570 -0.192% 74
Curaçao Curaçao 138,802 +0.075% 180
Cayman Islands Cayman Islands 74,457 +1.94% 185
Cyprus Cyprus 911,163 +1.13% 154
Czechia Czechia 8,133,112 +0.417% 76
Germany Germany 65,050,855 -0.3% 14
Djibouti Djibouti 920,158 +1.6% 153
Dominica Dominica 47,874 -0.0355% 191
Denmark Denmark 5,297,169 +0.654% 93
Dominican Republic Dominican Republic 9,714,680 +1.52% 66
Algeria Algeria 35,460,902 +2.05% 28
Ecuador Ecuador 11,793,320 +1.23% 58
Egypt Egypt 50,412,120 +2.12% 19
Eritrea Eritrea 1,552,519 +3.4% 143
Spain Spain 39,925,214 +1.26% 26
Estonia Estonia 960,651 +0.424% 152
Ethiopia Ethiopia 31,246,661 +4.85% 31
Finland Finland 4,840,788 +1.07% 98
Fiji Fiji 549,766 +1.32% 159
France France 56,213,841 +0.663% 17
Faroe Islands Faroe Islands 23,642 +1.03% 207
Micronesia (Federated States of) Micronesia (Federated States of) 26,655 +1.23% 205
Gabon Gabon 2,318,241 +2.49% 131
United Kingdom United Kingdom 58,761,798 +1.36% 15
Georgia Georgia 2,247,000 -0.412% 133
Ghana Ghana 20,606,184 +2.95% 42
Gibraltar Gibraltar 39,329 +2.23% 199
Guinea Guinea 5,683,101 +3.59% 90
Gambia Gambia 1,796,200 +3.27% 138
Guinea-Bissau Guinea-Bissau 1,010,266 +3.19% 151
Equatorial Guinea Equatorial Guinea 1,417,002 +3.02% 146
Greece Greece 8,413,270 +0.224% 75
Grenada Grenada 43,680 +0.671% 195
Greenland Greenland 50,100 +0.186% 190
Guatemala Guatemala 9,855,133 +2.4% 65
Guam Guam 159,791 +0.842% 179
Guyana Guyana 227,020 +1.14% 172
Hong Kong SAR China Hong Kong SAR China 7,524,100 -0.159% 78
Honduras Honduras 6,583,976 +2.72% 86
Croatia Croatia 2,278,991 +0.804% 132
Haiti Haiti 7,119,101 +2.55% 82
Hungary Hungary 6,997,606 +0.12% 83
Indonesia Indonesia 167,836,195 +1.91% 5
Isle of Man Isle of Man 45,201 +0.418% 193
India India 534,916,498 +2.29% 2
Ireland Ireland 3,484,254 +1.83% 116
Iran Iran 71,146,301 +1.64% 12
Iraq Iraq 33,082,569 +2.51% 30
Iceland Iceland 380,714 +2.92% 165
Israel Israel 9,270,806 +1.37% 69
Italy Italy 42,642,176 +0.431% 22
Jamaica Jamaica 1,639,964 +0.648% 141
Jordan Jordan 10,652,445 +1.2% 62
Japan Japan 114,223,468 -0.336% 7
Kazakhstan Kazakhstan 12,023,384 +1.65% 57
Kenya Kenya 16,957,535 +3.8% 49
Kyrgyzstan Kyrgyzstan 2,757,346 +2.74% 126
Cambodia Cambodia 4,592,262 +3.07% 104
Kiribati Kiribati 78,623 +2.71% 184
St. Kitts & Nevis St. Kitts & Nevis 14,625 +0.585% 211
South Korea South Korea 42,176,083 +0.126% 24
Kuwait Kuwait 4,973,861 +2.48% 96
Laos Laos 3,022,926 +3.11% 120
Lebanon Lebanon 5,202,316 +0.755% 94
Liberia Liberia 3,035,243 +3.15% 119
Libya Libya 6,045,575 +1.4% 87
St. Lucia St. Lucia 34,701 +0.954% 202
Liechtenstein Liechtenstein 5,912 +1.49% 214
Sri Lanka Sri Lanka 4,255,211 +0.512% 109
Lesotho Lesotho 722,194 +2.73% 156
Lithuania Lithuania 1,990,910 +0.928% 135
Luxembourg Luxembourg 625,302 +1.9% 158
Latvia Latvia 1,281,639 -0.591% 147
Macao SAR China Macao SAR China 687,000 +1.21% 157
Morocco Morocco 24,997,624 +1.79% 39
Monaco Monaco 38,631 -0.834% 200
Moldova Moldova 1,041,700 -2.28% 150
Madagascar Madagascar 13,179,471 +4.17% 56
Maldives Maldives 223,824 +1.39% 173
Mexico Mexico 107,125,438 +1.21% 9
Marshall Islands Marshall Islands 29,741 -2.88% 204
North Macedonia North Macedonia 1,072,942 -1.31% 149
Mali Mali 11,488,784 +4.65% 61
Malta Malta 545,663 +3.98% 160
Myanmar (Burma) Myanmar (Burma) 17,696,180 +1.8% 45
Montenegro Montenegro 429,445 +0.542% 163
Mongolia Mongolia 2,441,374 +1.51% 129
Northern Mariana Islands Northern Mariana Islands 40,811 -1.82% 198
Mozambique Mozambique 13,619,288 +4.49% 55
Mauritania Mauritania 3,021,925 +4.28% 121
Mauritius Mauritius 515,693 +0.0666% 161
Malawi Malawi 4,027,450 +4.39% 113
Malaysia Malaysia 28,162,033 +1.85% 33
Namibia Namibia 1,690,662 +3.96% 140
New Caledonia New Caledonia 213,937 +1.49% 175
Niger Niger 4,658,225 +4.41% 102
Nigeria Nigeria 128,043,517 +3.51% 6
Nicaragua Nicaragua 4,160,404 +1.87% 110
Netherlands Netherlands 16,816,154 +0.951% 51
Norway Norway 4,698,428 +1.34% 101
Nepal Nepal 6,631,755 +1.96% 85
Nauru Nauru 11,947 +0.606% 212
New Zealand New Zealand 4,649,353 +1.91% 103
Oman Oman 4,700,463 +5.31% 100
Pakistan Pakistan 96,399,415 +2.39% 10
Panama Panama 3,155,846 +1.82% 118
Peru Peru 27,079,663 +1.38% 34
Philippines Philippines 56,316,242 +1.51% 16
Palau Palau 14,658 +0.342% 210
Papua New Guinea Papua New Guinea 1,468,018 +2.96% 144
Poland Poland 22,053,455 -0.176% 41
Puerto Rico Puerto Rico 3,000,334 +0.0165% 123
North Korea North Korea 16,827,548 +0.781% 50
Portugal Portugal 7,322,380 +1.94% 81
Paraguay Paraguay 4,399,250 +1.79% 106
Palestinian Territories Palestinian Territories 4,119,033 +2.78% 111
French Polynesia French Polynesia 175,904 +0.457% 178
Qatar Qatar 2,840,304 +7.63% 125
Romania Romania 10,465,254 +0.432% 63
Russia Russia 108,436,954 +0.0843% 8
Rwanda Rwanda 2,577,730 +3.24% 127
Saudi Arabia Saudi Arabia 30,065,601 +5.01% 32
Sudan Sudan 18,541,003 +1.95% 43
Senegal Senegal 9,265,794 +3.38% 70
Singapore Singapore 6,036,860 +2.01% 88
Solomon Islands Solomon Islands 216,989 +4.17% 174
Sierra Leone Sierra Leone 3,869,811 +3.25% 114
El Salvador El Salvador 4,816,773 +1.26% 99
San Marino San Marino 33,274 +0.444% 203
Somalia Somalia 9,223,050 +4.84% 71
Serbia Serbia 3,779,144 -0.094% 115
South Sudan South Sudan 2,574,999 +5.8% 128
São Tomé & Príncipe São Tomé & Príncipe 181,396 +2.84% 177
Suriname Suriname 422,106 +1.07% 164
Slovakia Slovakia 2,937,243 +0.182% 124
Slovenia Slovenia 1,200,055 +0.902% 148
Sweden Sweden 9,404,504 +0.583% 68
Eswatini Eswatini 310,867 +1.91% 170
Sint Maarten Sint Maarten 43,350 +1.41% 196
Seychelles Seychelles 71,893 +2.05% 187
Syria Syria 14,321,057 +5.73% 53
Turks & Caicos Islands Turks & Caicos Islands 43,944 +0.928% 194
Chad Chad 5,012,056 +6.47% 95
Togo Togo 4,287,946 +3.59% 107
Thailand Thailand 38,930,064 +1.28% 27
Tajikistan Tajikistan 3,020,850 +2.98% 122
Turkmenistan Turkmenistan 4,086,300 +2.75% 112
Timor-Leste Timor-Leste 459,998 +2.38% 162
Tonga Tonga 24,179 -0.19% 206
Trinidad & Tobago Trinidad & Tobago 732,907 +0.291% 155
Tunisia Tunisia 8,702,015 +1.11% 73
Turkey Turkey 66,613,051 +0.782% 13
Tuvalu Tuvalu 6,456 -0.707% 213
Tanzania Tanzania 26,146,101 +4.92% 37
Uganda Uganda 13,698,634 +5.16% 54
Ukraine Ukraine 26,609,678 +0.608% 35
Uruguay Uruguay 3,246,112 +0.0405% 117
United States United States 284,043,692 +1.24% 3
Uzbekistan Uzbekistan 18,408,555 +2.18% 44
St. Vincent & Grenadines St. Vincent & Grenadines 55,062 +0.0818% 189
Venezuela Venezuela 25,140,326 +0.446% 38
British Virgin Islands British Virgin Islands 19,803 +2.11% 209
U.S. Virgin Islands U.S. Virgin Islands 100,530 -0.424% 181
Vietnam Vietnam 40,592,000 +2.46% 25
Vanuatu Vanuatu 85,704 +2.97% 183
Samoa Samoa 37,979 +0.121% 201
Yemen Yemen 16,426,847 +4.7% 52
South Africa South Africa 44,355,700 +1.96% 20
Zambia Zambia 9,999,698 +4.14% 64
Zimbabwe Zimbabwe 5,434,450 +2.28% 92

The urban population is a critical demographic indicator representing the portion of people living in urban areas as compared to the overall population of a specific region. This metric is essential for understanding societal trends, economic priorities, and the effectiveness of urban planning and development. As of 2023, the world's urban population reached approximately 4.6 billion, reflecting a significant shift towards urbanization over the decades.

Urbanization is not merely a demographic phenomenon; it is inherently linked to various socio-economic indicators. Higher urban population figures often correlate with increased economic opportunities, as cities generally serve as growth engines for nations. They attract industries, services, and jobs, drawing individuals from rural backgrounds seeking better livelihoods. Thus, urban population statistics can provide insight into economic vitality, employment rates, and migration patterns.

The importance of tracking urban population statistics extends beyond immediate economic concerns. Urban areas face unique challenges, such as increased demand for housing, transportation, infrastructure, and services including healthcare and education. A rising urban population can lead to congestion, environmental degradation, and resource depletion if not managed effectively. Policymakers and urban planners rely on accurate urban population data to create strategies that ensure sustainable development and livable cities.

Various factors affect urban population growth. Economic opportunities, educational institutions, and access to essential services are primary drivers for migration from rural to urban areas. Political stability and safety also play a pivotal role, as people tend to move towards regions perceived as secure and prosperous. In addition to these factors, environmental considerations contribute to urbanization; for example, people may relocate to cities that offer better responses to climate change impacts or natural disasters.

The 2023 statistics show that the top five urban populations are concentrated in rapidly developing countries. China boasts the highest urban population, standing at approximately 910 million. This immense figure reflects China's significant urbanization efforts, marked by government policies favoring industrialization and urban development. India follows with around 523 million, demonstrating its growth as a major economic force, despite facing significant urban challenges such as poverty and infrastructure deficits. The United States ranks third, with approximately 279 million, indicating a mature urban system but revealing ongoing issues related to inequality and housing affordability. Brazil and Indonesia, with urban populations of 185 million and 165 million respectively, illustrate the diverse trajectories through which countries can expand their urban demographics.

At the other end of the scale, some regions exhibit minimal urban population figures. Small nations like Liechtenstein, with only about 5,825 people living in urban areas, starkly contrast the sprawling metropolises above. The bottom five areas reflect unique demographic realities that may include geographical constraints, limited economic opportunities, or cultural preferences for rural living. Such disparities underscore the varying paths of urbanization across the globe.

Tracking urban population growth has practical implications for global decision-making. A continuously growing urban population implies the necessity for sustainable urban planning. Strategies include improving public transport, enhancing waste management systems, and building affordable housing. Implementing smart city solutions that leverage technology to optimize resource use can also improve the quality of life in urban settings. Additionally, fostering community participation in urban planning can encourage local solutions tailored to specific challenges faced by cities.

However, should deficiencies arise in interpreting urban population data, it may lead to flawed policies and ineffective strategies. Misalignments between population data and resource allocation can exacerbate urban challenges, resulting in slum development, inadequate public services, and increased inequality. Thus, the accuracy and timeliness of urban population statistics are critical in shaping effective solutions.

The world, from 1960 to 2023, has seen a remarkable increase in urban population—from about 1 billion in 1960 to nearly 4.6 billion in 2023. This rapid urban growth highlights the ongoing migration patterns and demographic shifts that shape global landscapes. The world is witnessing urbanization becoming one of the primary forces driving economic and social change. As such, continual monitoring and analysis of the urban population are indispensable for understanding emerging trends and challenges faced by urban areas across different regions.

In conclusion, the urban population metric is not merely a numerical representation but a crucial reflection of global societal trends, economic potential, and the need for strategic planning. As countries navigate the complexities of rapid urbanization, leveraging this data will be vital in crafting sustainable solutions that allow cities to thrive while addressing the challenges of an ever-growing urban populace.

                    
# 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 = 'SP.URB.TOTL'

# 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 <- 'SP.URB.TOTL'

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