NEW Geloky now works inside Claude, ChatGPT and Cursor. See how Geloky inside Claude & ChatGPT →
  1. Help
  2. US ZIP code database

How to use the US ZIP code 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 33,791 ZIP areas, the ones the Census Bureau draws on its maps, each with its centre point, city, county, population and time zone. Pro adds the PO box, business and military ZIP codes, 41,685 ZIP codes in all, and more columns. Complete adds who lives there and the outline of every ZIP area.

  • Free is for any project, commercial ones too, with a link to the database’s page where people can see it.
  • Pro and Complete need no link: use them across your organisation, in your websites and apps too.
  • 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.
  • Need counties and cities too? All three US databases, each in its Complete version, cost $199 together instead of $297.
Free · $033,791 ZIP areas
Pro · $4941,685 ZIP codes
Complete · $99Pro + demographics and outlines
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.

  • No Geloky account needed. Keep the email: its link is your download page for 12 months.
  • Each format downloads on its own, or take them all in one zip.
  • Lost the link? Find my downloads sends it again to the email you paid with.
CSVus-zip-codes-pro.csv · 7.5 MB
Download
Excelus-zip-codes-pro.xlsx · 4.6 MB
Download
SQLMySQL and PostgreSQL · 3 MB zip
Download
JSONus-zip-codes-pro.json · 20.5 MB
Download
Download all formats (.zip)
3

Open it in Excel or Google Sheets

Open the Excel file as it is: its ZIP codes are stored as text, so 00601 keeps its leading zero. To add a ZIP code’s county or time zone to your own list, put the database on a sheet named Zips and look each ZIP code up:

=XLOOKUP(TEXT(B2,"00000"), Zips!A:A, Zips!H:H, "not found")
  • Column H is county_name. Use J for the time zone, or I for the population.
  • TEXT(B2,"00000") turns a ZIP code your list stores as a number, like 2138, back into 02138.
  • Opening the CSV instead? Use Data › From Text/CSV and set the zip column to Text, or Excel drops the zeros.
  • In Google Sheets, upload the Excel file: its ZIP codes stay text, and the same XLOOKUP works.
fx=XLOOKUP(TEXT(B2,"00000"), Zips!A:A, Zips!H:H, "not found")
CustomerZIPCounty
Harbor Books02138Middlesex
Lake Diner60601Cook
Mile High Dental80202Denver
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 us_zip_codes, with the ZIP code as its key, and fills it:

mysql -u you -p yourdb < us-zip-codes-pro-mysql.sql
psql -d yourdb -f us-zip-codes-pro-postgresql.sql

Then ask it what you need, such as the ZIP areas within 5 miles of downtown Chicago, nearest first (MySQL 8):

SELECT zip, city, ROUND(ST_Distance_Sphere(
  POINT(lng, lat), POINT(-87.6298, 41.8781)) / 1609.344, 1) AS miles
FROM us_zip_codes WHERE zip_area
HAVING miles <= 5 ORDER BY miles;
  • A column with several counties separates them with |, in the same order as their shares: 72001|72081 and 99.7|0.3.
  • TRUE and FALSE load as booleans. A value the sources don’t have is NULL.
  • Loading a new release? Drop the old table first: DROP TABLE us_zip_codes;
zipcitymiles
60604Chicago0.0
60603Chicago0.2
60602Chicago0.3
60606Chicago0.5
60601Chicago0.6
23 rows: the ZIP areas within 5 miles
5

Use the JSON or the ZIP outlines

The JSON file is one array with an object for each ZIP code, under the same names as the CSV columns. Complete adds the outline of each of the 33,791 ZIP areas, as GeoJSON and KML, for maps in QGIS, Google Earth, Leaflet or MapLibre.

  • In the JSON, numbers are numbers, ZIP codes are strings, and a missing value is null.
  • Each outline carries one property, zip, to join it to the table.
  • The outlines are detailed: about 140 MB as GeoJSON. For a web map, simplify them first, with mapshaper for example.
us-zip-outlines.geojson · the 33,791 ZIP areas, each with its zip
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, when HUD’s ZIP code crosswalk changes. The Census figures change once a year.

  • Your download page lists every release you can get, newest first.
  • Bought Pro? Upgrade to Complete on that page for the $50 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 · $50

FAQ

Common questions

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

Free holds the ZIP areas the Census Bureau draws. 7,894 ZIP codes have no area of their own: PO box ZIP codes, those of one company or building, and the military’s APO, FPO and DPO ZIP codes. Pro and Complete add them: each at the middle of the census tract that holds most of its addresses, or at the centre of its town, with approximate set to TRUE; the military ones without a location, with military set to TRUE.

Your first 100 rows are free. Every day.

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