May 5, 2025
I was addressing wedding thank you notes to friends and family across the country when I noticed something with the ZIP codes: I had one New York friend living in 10536, and a Colorado friend living in 80305. Here in Metro Detroit, the ZIP codes are of the form 48XXX. The emerging pattern sparked a question: what is the structure of United States ZIP codes, and is there an interesting way to visualize them? Let's dig in.
ZIP stands for Zone Improvement Plan, and the system was introduced in 1963 by the USPS, much later than I expected. The goal was to improve mail efficiency as the country had grown west without a robust system in place. Like you may have noticed, the leading digits roughly correspond to the geographical region:
0-1: Northeast
2-3: Mid-Atlantic, Southeast
4-5: Midwest (represent)
6-7: Plains, South Central
8-9: Mountain West, West Coast, Alaska
There are a few anomalies such as Puerto Rico being in the 0's.
The second and third digits point to the largest nearby post office. The last two digits point to the specific delivery area. Occasionally you see ZIP codes in the form XXXXX-XXXX; the additional four digits in the ZIP+4 system (introduced in 1983) provide the specific street, side of street, and/or floor of large buildings.
I started with a US ZIP code database which provides a .csv for every ZIP code in the US. I dusted off Google Colab, and imported the file. By mapping ZIP code numbers to a continuous color gradient from red to purple, we can create a full spectrum of data points where the color corresponds to the magnitude of the ZIP code, and we can treat longitude and latitude values as x and y coordinates. See for yourself below:
Note that I am only including the Contiguous US (sorry Guam). I added the code I used to the end of this project so feel free to tinker with it yourself. I would love to hear what other trends I missed in this brief analysis.
I have not been able to find a map like this of its kind online. Essentially what we have created is a ZIP code heat map. It is interesting to me how the pattern zig zags through the US, starting in the Northeast, but not following a precise East to West movement. It is also interesting how this map indirectly shows high population areas, as there are more ZIP codes in those areas. Of course the East coast, California, Texan cities, etc. are all well-illuminated.
In case it is not clear, there is no actual map of the US in this image, just individual points. Still, we can make out patterns, cities, and even some state lines (Montana/Idaho is especially clear). My mind is tricking me into seeing land marks such as the Mississippi River, perhaps because there are simply more people who settled close to the river. I marked up the map for some of these trends below):
This reminds me of the famous Joe Rogan clip where Paul Stamets explains how slime mold and strategically-placed nutrients can be used to plan city public transit systems, highways, etc. Here, the ZIP codes are like the agar, and you could imagine efficient pathways being organized between them.
Based on the above realization of population centers, I created another map where each dot size is proportional to the number of people in each ZIP code. Interestingly, while this did further illuminate population density, it also illuminated ZIP codes with a large area, since in less populous areas, the ZIP codes span a much larger distance. Boise, the blue dot below at (-116, 43), is a good example of this. Boise has just north of 200,000 inhabitants, but appears as bright as cities with 500,000+. Here is the population-normalized graph:
The main differences I see here is that the big cities are far brighter, but areas like Denver, Salt Lake City, and Las Vegas appear as massive anomalies in otherwise barren areas. In the first map I could not really make these areas out.
It turns out the largest ZIP codes by population are 08701 in New Jersey and 92336 in California. A little further down that list, the 23rd largest ZIP code by population was 73099 in Oklahoma. In fact, combing through the first 100 largest, many of the ZIP codes are not in large Metro areas. This shows that size of ZIP code does not necessarily correspond to population density.
However, the ZIP code population distribution is skewed heavily right, with a mean of 28,103 people, a median of 2,799 people, and a standard deviation of 16,047 people. Here is the distribution:
I do not know how this is possible and did not dig down the rabbit hole, but apparently there are a few ZIP codes currently with zero people, including 19716, 29423, and 44901 in Deleware, South Carolina, and Ohio respectively. Feel free to verify that and let me know if I am missing something.
Next, I wanted to look at population on a 3D plot. Keeping x and y axes the same, and making z correspond to population, we can check if this provides any additional insights. Plot below:
Admittedly, the sheer number of lines makes this a little confusing and unhelpful. The color still corresponds to the ZIP code magnitude, and thus looks like a bit of a mess. To clear it up a bit, we can reduce the number of data points to 1,000. See below.
The only interesting thing I note here is the Eastern skew of ZIP codes that is more clear here than previously for whatever reason. Also, Seattle looks pretty big. It is the 19th biggest city in the US, but the Metro area is closer to a Detroit or Minneapolis.
This next part is where I had to phone a friend (ChatGPT). This is a GeoGussr-inspired ZIP code game I created, hopefully with more features coming soon. The goal is to get as close to the ZIP code it tells you, and the score is calculated based on how well you did. If you read through this, I imagine you will do pretty well. Good luck!
Lastly, I created a ZIP code lookup. Type in where you live, and see how yours stacks up compared to the rest of the country.
This was a simple project that I probably dragged out more than I needed to, but it was pretty fun. I have a similar, more interesting, project in the works that I will be publishing shortly. It is fascinating to me that something as simple as ZIP codes could create what I consider a pretty beautiful map. My father-in-law told me I should print and sell it, what do you think? It might make a cool dorm room poster!
Here are a few closing fun facts for you:
The ZIP code with the highest life expectancy is 78634 in Hutto, Texas
The only ZIP code containing 5 consecutive identical digits is 44444 in Newton Falls, Ohio. Pretty cool fun fact for a pretty lame state.
33012 in Hialeah, Florida has the most McDonald's (8). It's also the 19th most obese ZIP code in the US.
Python packages used: pandas, matplotlib, numpy, os. See code attached.