Code to generate a combined data set of US ZIP codes, FIPS codes, and counties from existent government data sets.
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.

US Geographic Codes Dataset

This code is used to generate a combined data set of US ZIP, FIPS, and County data for every most ZIP Codes in the U.S.

The Data

The dataset can be found on Kaggle.

The dataset is organized as follows:

  • Zip Code: USPS ZIP code from here
  • State Name: Full state name (E.g. Michigan)
  • State Abrv: USPS abbreviated state name (E.g: MI)
  • State Code: FIPS State Code from here
  • County Name: County in which ZIP is located
  • County Code: FIPS County Code
  • FIPS Code: FIPS State Code + FIPS County Code from here
  • ANSI Code: American National Standards Institute Code
  • Centroid Lat: Latitude value of the county center
  • Centroid Long: Longitude value of the county center
  • Vertices Lat: Latitude values for each vertex of the county polygon from here
  • Vertices Long: Longitude values for each vertex of the county polygon


The data used to create this data set was taken from several recent government data sets.

These are:


The final csv is in 'latin1' encoding to preserve the Spanish county name in Puerto Rico.

This data is from, and shall remain in the public domain, and the onus of responsibility lies with the user of this data.