How Many Ports Are There in the World? The World Port Index Explained

On this page

Problem statement

How many ports are there in the world? The World Port Index lists 3,807, from fishing harbours to the largest container terminals, and calls 174 of them large. Any count depends on what counts as a port, and the index's answer is its own: places that matter to navigation, described for mariners, classified by NGA into four sizes and ten harbour types. This page shows what the index counts as a port and its size, what it records about each, and how much of that is known, with how to get the data without code.

Quick answer

Count the ports by harbour size, after turning blank cells and zero depths into missing values:

print(ports["Harbor Size"].value_counts(dropna=False).to_string())
print(f"large and medium: {ports['Harbor Size'].isin(['Large', 'Medium']).sum()}; first ports of entry: {(ports['First Port of Entry'] == 'Yes').sum():,}")
Harbor Size
Very Small    2109
Small         1021
Medium         376
Large          174
NaN            127
large and medium: 550; first ports of entry: 1,720

Of the 3,807 ports, 2,109 are very small, 1,021 small, 376 medium and 174 large; 127 have no size. 550 are medium or large, the ports that can take ocean-going ships of some size. 1,720 are first ports of entry, where a ship arriving from abroad can clear customs and immigration.

Bars of ports by harbour size: 2,109 very small, 1,021 small, 376 medium and 174 large. Bars of ports by harbour size: 2,109 very small, 1,021 small, 376 medium and 174 large.
Ports by harbour size.

Types, contents and gaps

1. What a port is in the index

print(ports["Harbor Type"].value_counts(dropna=False).to_string())
Harbor Type
Coastal (Natural)       1252
Coastal (Breakwater)     793
River (Natural)          666
Open Roadstead           665
NaN                      179
River (Basins)            87
Canal or Lake             72
River (Tide Gates)        55
Coastal (Tide Gates)      34
Typhoon Harbor             4

A port is a place a ship can stop, of one of ten types. 1,252 are natural coastal harbours and 793 coastal harbours protected by breakwaters; 666 are natural river ports and 665 open roadsteads, anchorages off an open coast with little or no shelter. A few are canal or lake ports, river or coastal ports behind tide gates, and 4 typhoon harbours, refuges from typhoons.

2. What it records about each

groups = pd.Series([c.split(" - ")[0] for c in ports.columns if " - " in c]).value_counts()
print(groups.to_string())
Facilities              14
Supplies                 7
Communications           6
Services                 5
Entrance Restriction     4
Pilotage                 4
Lifts                    4
Quarantine               3
Cranes                   3
Tugs                     2

Beyond position and size, each port has columns in groups: 14 facility types, from wharves to LNG terminals, 7 kinds of supplies, 6 of communications, 5 services, 4 entrance restrictions, 4 kinds of pilotage, 4 lift classes, 3 quarantine questions, 3 crane types and 2 kinds of tug. Each is a yes, no or unknown.

Horizontal bars of the number of yes-or-no questions per group: 14 facilities, 7 supplies, 6 communications, 5 services, down to 2 tug questions. Horizontal bars of the number of yes-or-no questions per group: 14 facilities, 7 supplies, 6 communications, 5 services, down to 2 tug questions.
What the index asks about every port.

3. Where the knowledge is thin

flags = [c for c in ports.columns if set(ports[c].dropna().unique()) <= {"Yes", "No", "Unknown"}]
known = ports[flags].ne("Unknown").mean(axis=1)
print(ports.groupby("Harbor Size", dropna=False).apply(lambda d: known[d.index].mean()).round(3).to_string())
Harbor Size
Large         0.581
Medium        0.524
Small         0.428
Very Small    0.332
NaN           0.106

Little of that is known. The yes-or-no columns are answered, yes or no rather than Unknown, for 58.1% of questions about large ports and only 33.2% about very small ones. The index is a good list of where ports are and how big; for what they offer, it is complete only for the major ports.

The large ports by water body

The data used on this page

The US National Geospatial-Intelligence Agency's World Port Index (Pub. 150), the CSV served by its Maritime Safety Information site, downloaded on 28 October 2026 and saved on this site, because NGA revises the index as port information changes. A US government publication, free to use. Depths and lengths are in metres. Countries, land and populated places are Natural Earth's, public domain.

from pathlib import Path
import zipfile

import geopandas as gpd
import numpy as np
import pandas as pd
import requests

Path("data").mkdir(exist_ok=True)
# NGA's World Port Index (Pub. 150) as CSV, with Natural Earth's populated places, countries and land. Saved
# 28 October 2026: NGA revises the index as port information changes.
# Live: https://msi.nga.mil/api/publications/download?type=view&key=16920959/SFH00000/UpdatedPub150.csv
ARCHIVE = "nga-world-port-index-2026-10-28.zip"
if not Path(f"data/{ARCHIVE}").exists():
    Path(f"data/{ARCHIVE}").write_bytes(requests.get(f"https://data.spatialworkflow.io/{ARCHIVE}", timeout=600).content)
Z = zipfile.ZipFile(f"data/{ARCHIVE}")
for f in ["ne_10m_populated_places_simple.zip", "ne_110m_admin_0_countries.zip", "ne_50m_land.zip"]:
    Path(f"data/{f}").write_bytes(Z.read(f))
wpi = pd.read_csv(Z.open("UpdatedPub150.csv"), encoding="utf-8-sig")
wpi = wpi.replace(r"^\s*$", np.nan, regex=True)                                  # blank cells are a single space
DEPTHS = [c for c in wpi.columns if c.endswith("(m)")]
wpi[DEPTHS] = wpi[DEPTHS].where(wpi[DEPTHS] > 0)                                    # 0 means not recorded
ports = gpd.GeoDataFrame(wpi, geometry=gpd.points_from_xy(wpi.Longitude, wpi.Latitude), crs=4326)
print(f"World Port Index: {len(ports):,} ports in {ports['Country Code'].nunique()} countries and territories")
World Port Index: 3,807 ports in 195 countries and territories

Example 1: the largest ports by region

big = ports[ports["Harbor Size"] == "Large"]
print(big["World Water Body"].value_counts().head(6).to_string())
print(big["Country Code"].value_counts().head(5).to_dict())
World Water Body
North Atlantic Ocean                                 21
Mediterranean Sea; North Atlantic Ocean              11
North Sea; North Atlantic Ocean                       9
North Pacific Ocean                                   8
Baltic Sea; North Atlantic Ocean                      7
Gulf of Finland; Baltic Sea; North Atlantic Ocean     7
{'United States': 21, 'Italy': 12, 'Japan': 11, 'United Kingdom': 7, 'France': 6}

Large ports cluster on the North Atlantic: 21 list it as their only water body, and more are on its seas, the Mediterranean, the North Sea and the Baltic. The United States has 21 large ports, Italy 12, Japan 11, the United Kingdom 7 and France 6. The water body column lists the sea first and the ocean last, a chain the ports by sea page uses.

Horizontal bars of the share of yes-or-no questions answered by harbour size: 58.1% for large ports down to 33.2% for very small ones. Horizontal bars of the share of yes-or-no questions answered by harbour size: 58.1% for large ports down to 33.2% for very small ones.
How much is known, by harbour size.

Getting the port data without code

  • Look first: NGA's World Port Index page lets you look ports up by name and country; each port's entry lists its depths, restrictions, facilities and services as the agency records them.
  • Download: the same page offers the whole index for download, including the CSV these pages read. It opens in a spreadsheet, and QGIS can map it with Longitude and Latitude as the X and Y fields.
  • What it is for: the index is a navigation publication, written for mariners planning a voyage. It describes harbours and their approaches, not cargo volumes: it says whether a port has container facilities, not how many containers it handles.
  • Conventions: empty cells are a single space, unknown measurements are 0, and every yes-or-no column has a third answer, "Unknown". Harbour size is NGA's classification of the port's overall scale; the index does not define it by a measured threshold.
  • The copy these pages use: downloaded on 28 October 2026 and saved at data.spatialworkflow.io, with Natural Earth's places, countries and land.
  • Credit: National Geospatial-Intelligence Agency, World Port Index (Pub. 150), with the date you downloaded it. It is a US government work.