NEW Geloky now works inside Claude, ChatGPT and Cursor. See how Geloky inside Claude & ChatGPT →
  1. Help
  2. World city database

How to use the world city database

Pick a version, download it, and open it in Excel or load it into your database, with the commands to copy. Then get every release for 12 months at the same link.

Updated

1

Pick a version

Free holds the 51,032 bigger cities of 245 countries: every place of 7,500 people or more, and every country’s and region’s capital, each with its point, country, region, population and time zone. Pro holds 2,513,129 cities, towns and villages: every place in or near a village, town or city, every place of 500 people or more and every seat of a county or district, with more columns: the county or district, the settlement, elevation, UTC offset and daylight saving. Complete holds every populated place GeoNames lists, 5,001,711 in all.

  • Every version is CC BY 4.0, as GeoNames’ data is: credit GeoNames where you use it. The free version also links to the database’s page.
  • Pro and Complete need no link to Geloky; with them, credit the European Commission too, for the settlement column.
  • Free’s columns come first in Pro and Complete, in the same order, so a formula or a query keeps working when you move up.
Free · $051,032 places
Pro · $992,513,129 places
Complete · $1995,001,711 places
2

Download your files

The free version downloads at once: a zip with the CSV, the Excel file and a README. For Pro or Complete, FastSpring’s checkout opens on the page. Once you have paid, the page turns into your download page, and a private link to it comes by email. Pro and Complete come as two zips: the CSV, and the SQL files for MySQL and PostgreSQL.

  • No Geloky account needed. Keep the email: its link is your download page for 12 months.
  • Pro and Complete are too big for Excel: unzip the CSV and open it in a database, or in a tool made for big files.
  • Lost the link? Find my downloads sends it again to the email you paid with.
CSVworld-cities-pro-csv.zip · 57.8 MB
Download
SQLMySQL and PostgreSQL · 119.6 MB zip
Download
3

Open it in Excel or Google Sheets

The free version’s Excel file opens as it is. To add each city’s time zone to your own list, put the database on a sheet named Cities and look each city up by its name and two-letter country code (Excel 365; in Google Sheets, wrap it in ARRAYFORMULA( )):

=XLOOKUP(A2&B2, Cities!A:A&Cities!F:F, Cities!K:K, "not found")
  • Column K is timezone. Use J for the population, C and D for the latitude and longitude, or H for the region.
  • Names typed without accents? Look them up in column B, city_ascii: Krakow finds Kraków.
  • A name can repeat in a country: the free version has 11 places called Springfield in the United States. XLOOKUP returns the first, so add the region, column H, when it matters.
  • Need Pro in Excel? Load one country: Data › From Text/CSV › Transform Data, filter iso2, then Close & Load.
fx=XLOOKUP(A2&B2, Cities!A:A&Cities!F:F, Cities!K:K, "not found")
CityCountryTime zone
KrakówPLEurope/Warsaw
São PauloBRAmerica/Sao_Paulo
OsakaJPAsia/Tokyo
4

Load it into a database

The SQL zip holds one file for MySQL and MariaDB, and one for PostgreSQL. Each creates a table named world_cities, with GeoNames’ id as its key, and fills it:

mysql -u you -p yourdb < world-cities-pro-mysql.sql
psql -d yourdb -f world-cities-pro-postgresql.sql

Then ask it what you need, such as the places of 100,000 people or more within 50 km of Toronto, the biggest first (MySQL 8):

SELECT city, population, ROUND(ST_Distance_Sphere(
  POINT(lng, lat), POINT(-79.38389, 43.65333)) / 1000) AS km
FROM world_cities WHERE population >= 100000
HAVING km <= 50 ORDER BY population DESC;
  • Loading takes a few minutes: Pro has 2.5 million rows and Complete 5 million. Add an index on the columns you search, such as iso2.
  • TRUE and FALSE load as booleans. A value the sources don’t have is NULL: many villages have no population.
  • Loading a new release? Drop the old table first: DROP TABLE world_cities;
citypopulationkm
Toronto2,794,3560
Mississauga717,96124
Brampton656,48031
Etobicoke365,00015
Markham338,50326
13 rows: the places of 100,000 people or more within 50 km
5

Pick the places you need

Pro and Complete say what kind of place each one is, so you keep just what your project needs: capital marks the capitals of countries, regions and districts, population the places GeoNames counts, and settlement the kind of area each place lies in, such as the cities and towns of Kenya:

SELECT city, country FROM world_cities
WHERE settlement IN ('city', 'dense town', 'semi-dense town')
  AND iso2 = 'KE';
  • settlement is city, dense town, semi-dense town, suburban, village, dispersed rural or mostly uninhabited: the most built-up kind of area within about a kilometre of the place.
  • capital says primary for a country’s capital, admin for a region’s and minor for a county’s or district’s.
  • feature_code is GeoNames’ own kind of place, such as PPLA for the seat of a region or PPLF for a farm village.
suburban888,366
village628,919
city343,689
dense town336,656
semi-dense town258,289
dispersed rural52,047
mostly uninhabited5,139
Pro’s 2,513,129 places by settlement
6

Get each update

For 12 months, every new release comes to the same link, and we email you when one is out. We aim to publish a release every quarter, from GeoNames’ newest data: new places, new names and new population figures.

  • Your download page lists every release you can get, newest first.
  • Bought Pro? Upgrade to Complete on that page for the $100 difference. Your updates keep their end date.
  • After the 12 months, everything you downloaded stays yours; only new releases stop.
VersionPro
Newest release4 Dec 2026
Updates until4 Dec 2027
Upgrade to Complete · $100

FAQ

Common questions

Still stuck? Write to hello@geloky.com — a person answers within a day.

Every populated place GeoNames lists, from capitals to hamlets. The 171,436 neighbourhoods it marks as parts of a city are left out, and so are historical and abandoned places; a few districts it lists as places of their own stay in, such as Paris’s arrondissements.

Your first 100 rows are free. Every day.

Free plan, no credit card · See your results on a map before you pay