← Back

ZIP Code to State, County, Metro in a Spreadsheet

2024-07-26 // Mark Tressler

Need an easy way to map your list of ZIP codes to state, county, town, metro, or congressional district? Row Zero is the best spreadsheet for big data and we've built a free ZIP code lookup in a spreadsheet.

Row Zero spreadsheets can handle billions of rows and connect live to your data warehouse. Click the links below for the ZIP code mapping you need or read the full guide.

ZIP Code to State, Town, Metro

View Spreadsheet
This spreadsheet includes the full list of U.S. ZIP codes by state, town and metro. There is one row for each of the 39,501 US ZIP codes. Columns include ZIP Code, State, City, Metro, ZIP Code Population. You can use this zip to state lookup to enrich your existing data or do a simple lookup. import file

NOTE: This United States Postal Service ZIP code lookup uses the "preferred" City and State for each USPS ZIP code as defined by the U.S. Postal Service. However, there are a few dozen ZIP codes that cross state boundaries and map to more than one state. This spreadsheet limits each ZIP code to one row and the "preferred" mapping for ease of use resulting in 39,501 ZIP codes.

Need help mapping this in your sheet? View how to map ZIP to state using XLOOKUP

ZIP Code to County

View Spreadsheet
This spreadsheet maps all U.S. ZIP codes to their county or counties. There is one row for each unique ZIP to county mapping. Note that ZIP codes can map to multiple counties, so there is more than one row for any of these ZIP codes. To help with this, the spreadsheet also includes the percentage of the ZIP code population that is located in a given county. For example, ZIP Code 35006 in Alabama maps to Jefferson County (93% of ZIP Code residents), Walker County (5%), and Tuscaloosa County (2%).

Columns in this ZIP to County lookup include ZIP Code, State, City, County, State Abbreviation, County FIPs Code, ZIP Code Population, % of ZIP Residents in County, # of Counties.

ZIP Code to Congressional District

View Spreadsheet
This spreadsheet maps all U.S. ZIP codes to Congressional Districts in the U.S. House of Representatives. There is one row for each unique ZIP to Congressional District mapping. Note that ZIP codes can map to multiple Congressional Districts, so there is more than one row for these ZIP codes. The spreadsheet includes the percentage of the ZIP code population that is located in a given Congressional District to help with this. For example, ZIP Code 35087 in Alabama maps to Alabama's 4th District (62% of ZIP Code residents) and Alabama's 5th District (38% of ZIP code residents).

Columns in the sheet include ZIP Code, State, City, Congressional District, Congressional District State, Congressional District Number, Congressional District Code, % of ZIP Residents in CD, and # of Congressional Districts ZIP maps to.

County to ZIP Codes

View Spreadsheet
This spreadsheet provides a list of ZIP codes by county. There is one row for each unique county to ZIP code mapping. Note that each county maps to multiple ZIP codes so there is more than one row for each county. To help with this, the spreadsheet includes the percentage of the county population that is located in a given ZIP Code. Finally, note that ZIP codes can cross county boundaries so some ZIP codes are mapped to multiple counties and ZIP codes are not necessarily fully contained within the county boundary.

Columns in this County to ZIP lookup include County, State, County FIPs Code, ZIP, USPS Default City for ZIP, USPS Default State for ZIP, % of County Residents in ZIP.

Congressional District to ZIP Codes

View Spreadsheet
This spreadsheet provides a list of ZIP codes by Congressional District. There is one row for each unique Congressional District to ZIP code mapping. Note that each district maps to multiple ZIP codes so there is more than one row for each Congressional District. To make this easier to understand, the spreadsheet includes the percentage of the Congressional District population that is located in a given ZIP Code.

Columns include Congressional District, Congressional District State, Congressional District Number, Congressional District Code, ZIP Code, USPS Default City for ZIP, USPS Default State for ZIP, % of CD Residents in ZIP.

How to map ZIP to State in your data using XLOOKUP

You can easily import your data into the spreadsheets above to map your data (or vice versa). Row Zero can open and edit big CSV files, parquet files, txt, etc. You an also connect the spreadsheet directly to your data warehouse.

Once all of the data is in the sheet, you can use a simple XLOOKUP or VLOOKUP function to map your data. For XLOOKUP, you simply type in "=XLOOKUP(" into a cell and then follow the instructions.

Here is an example of how to use XLOOKUP to map ZIP code to state in your data:

  1. Get your data in one sheet and the ZIP lookup data in another sheet. Make sure your ZIP code data is in plain text format and not a number.

  2. In the sheet with your data, in a new column type "=XLOOKUP(". For key, select the cell with the ZIP code you'd like to map. import file

  3. Then navigate to the ZIP lookup data sheet and select the ZIP code column as the lookup range, and then State column as the return range. Then add a comma and "" so that it returns blank if not found. Hit enter. import file

  4. Your new column will now fill in with the State that maps to the ZIP code. Pull the formula down and your done! import file

Connect ZIP Code Lookup to your data warehouse

Need to enrich data in your data warehouse with ZIP code mappings to state, county, etc.? Row Zero free plans allow you to connect your data warehouse to the ZIP code lookup (or any spreadsheet). Row Zero Pro plans support write-back to your data warehouse. Row Zero can connect live to several data sources including Snowflake, Databricks, Postgres, S3, and Redshift.

Challenges with ZIP codes in Excel or Google Sheets

Given the large number of ZIP codes, it can be a challenge to work with your data plus a big list of ZIP codes in Excel or Google Sheets. Excel has data limits and will slow down with a lot of data. Google Sheets limits are similar. To get around the limits of Excel and Google Sheets, you can use Row Zero. Row Zero has an experience similar to Google Sheets but was built for big data sets. It's free to try. Try Row Zero ZIP Code Lookup

What is a ZIP Code and what does it represent?

A US ZIP code is a postal code used by the United States Postal Service (USPS) to identify specific geographic regions, locations, or routes within the United States. ZIP stands for "Zone Improvement Plan," and the system was introduced in 1963 to improve the efficiency of mail delivery.

A standard ZIP code is five digits long. In addition to the basic five-digit code, there is an extended version called ZIP+4, which includes four additional digits after a hyphen. The ZIP+4 code provides more precise information about a location, such as a specific block or building.

The first digit of a ZIP code generally represents a group of U.S. states, the next two digits represent a region in that group (or sometimes a large city), and the final two digits identify a specific post office or delivery area.

Data Sources

Data sources for this United States Postal Service ZIP code lookup include the U.S. Census Bureau and the U.S. Office of Housing and Urban Development. Data has been updated as of August 2024 with the most recent data available.

FAQs