Skip to content

Instantly share code, notes, and snippets.

@JamoCA
Created January 3, 2024 16:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save JamoCA/dbdedf2e6ddd89db9530bcf89124083d to your computer and use it in GitHub Desktop.
Save JamoCA/dbdedf2e6ddd89db9530bcf89124083d to your computer and use it in GitHub Desktop.
Zip-Codes.com Database Specifications (markdown format)

Zip-Codes.com Database Specifications

Our ZIP Code Database contains over 78,000 precise data records. You can download the database once per month (if needed) for a full year. We have made every effort to provide the most accurate and up to date information.

Field Name Data Type Description

# Field Name Data Type Description
01 ZipCode Char(5) 00000-99999 Five digit numeric ZIP Code of the area.
02 City VarChar(35) Name of the city as designated by the USPS.
03 State Char(2) 2 letter state name abbreviation.
04 County VarChar(45) Name of Primary County or Parish this ZIP Code resides in.
05 AreaCode VarChar(55) The telephone area codes available in this ZIP Code.
06 CityType Char(1) Indicates the type of locale such as Post Office, Stations, or Branch.
07 CityAliasAbbreviation VarChar(13) 13 Character abbreviation for the city alias name.
08 CityAliasName VarChar(35) Alias name of the city if it exists.
09 Latitude Decimal(12, 6) Geographic coordinate as a point measured in degrees north or south of the equator.
10 Longitude Decimal(12, 6) Geographic coordinate as a point measured in degrees east or west of the Greenwich Meridian.
11 TimeZone Char(2) Hours past Greenwich Time Zone this ZIP Code belongs to.
12 Elevation Integer The elevation, measured in feet.
13 CountyFIPS Char(3) FIPS code for the County/Parish this ZIP Code resides in. 14 DayLightSaving Char(1) Flag indicating whether this ZIP Code observes daylight savings.
15 PreferredLastLineKey VarChar(10) Links this record with other products ZIP-Codes.com offers.
16 ClassificationCode Char(1) The classification type of this ZIP Code.
17 MultiCounty Char(1) Flag indicating whether this ZIP Code crosses county lines.
18 StateFIPS Char(2) FIPS code for the State this ZIP Code resides in.
19 CityStateKey Char(6) Links this record with other products ZIP-Codes.com offers such as the ZIP+4.
20 CityAliasCode VarChar(5) Code indication the type of the city alias name for this record. Record can be Abbreviations, Universities, Government, and more.
21 PrimaryRecord Char(1) Character 'P' denoting if this row is a Primary Record or not. Absence of character denotes a non-primary record.
22 CityMixedCase VarChar(35) The city name in mixed case (i.e. Not in all uppercase letters).
23 CityAliasMixedCase VarChar(35) The city alias name in mixed case (i.e. Not in all uppercase letters).
24 StateANSI VarChar(2) ANSI code for the State this ZIP Code resides in.
25 CountyANSI VarChar(3) ANSI code for the County/Parish this ZIP Code resides in.
26 FacilityCode VarChar(1) The type of locale identified in the city/state name.
27 CityDeliveryIndicator VarChar(1) Specifies whether or not a post office has city-delivery carrier routes.
28 CarrierRouteRateSortation VarChar(1) Identifies where automation Carrier Route rates are available.
29 FinanceNumber VarChar(6) A code assigned to Postal Service facilities.
30 UniqueZIPName VarChar(1) Field that specifies whether the City State Record contains the organization name for a unique ZIP Code.
31 CountyMixedCase VarChar(45) The primary county name in mixed case (i.e. Not in all uppercase letters).

Database Field Information

1) ZIP Code

5 digit zip code as designated by the United States Postal Service. U.S. Territories are also included in our data. (Puerto Rico, American Samoa, etc.)

2.) City

City name as designated by the United States Postal Service.

3.) State

The U.S. two digit state code. Sort on this field to get all your data grouped by state.

4.) Primary County Name

The primary county or parish where the ZIP Code resides. As with any of our data fields, you can sort the data by this field and the result will be data grouped by county.

5.) Area Code

The telephone area code(s) of the particular postal zone (ZIP Code). Sorting by this field will give you all the data grouped by area code.

6.) City Type

Describes the type of postal station in the "City Alias" field:

Code Description
A Airport Mail Facility (AMF)
B Branch
C Community Post Office (CPO)
D Area Distribution Center (ASC)
E Sectional Center Facility (SCF)
F Delivery Distribution Center (DDC)
G General Mailing Facility (GMF)
K Bulk Mail Center (BMC)
M Money Order Unit
N Non Postal Community Name
P Post Office
S Station
U Urbanization
X APO/FPO Military
Z P.O. Box
  1. A Branch or post office branch is a postal facility that is not the main post office and that is outside the corporate limits of the community.
  2. A Community Post Office (CPO) is a contract postal unit providing services in a small community in which other types of post office facilities have been discontinued.
  3. An Area Distribution Center (ASC) or processing and distribution facility (formerly known as a General Mail Facility) is a central mail facility that processes and dispatches incoming and outgoing mail to and from a designated service area.
  4. A Sectional Center Facility (SCF) is a ASC for a designated geographical area defined by one or more three-digit ZIP code prefixes.
  5. A Post Office, formerly known as a general post office or main post office, is the primary postal facility in a community.
  6. A Station or post office station is a postal facility that is not the main post office, but that is within the corporate limits of the community.
  7. An Urbanization is a facility type specific to Puerto Rico.

7.) City Alias Abbreviation

Abbreviation of the city alias where applicable.

8.) City Alias

The alias name for the ZIP Code. This may be a city name, postal entity, community or a municipality name.

The city alias names are the reason why our database has approximately 78,000+ records. There are approximately 41,000 U.S. zip codes, but since we list each city alias within a zip code, we end up with almost double the number of records.

9.) Latitude

The geographic coordinate of a point measured in degrees north or south of the equator. Updated quarterly.

10.) Longitude

The geographic coordinate of a point measured in degrees east or west of the Greenwich (prime) meridian. Updated quarterly.

11.) Time Zone

The code for time zone designation within the U.S. - the numbers 4-11 are assigned to the time zones.

Code Description
4 Atlantic (GMT -04:00)
5 Eastern (GMT -05:00)
6 Central (GMT -06:00)
7 Mountain (GMT -07:00)
8 Pacific (GMT -08:00)
9 Alaska (GMT -09:00)
10 Hawaii-Aleutian Islands (GMT -10:00)
11 American Samoa (GMT -11:00)
13 Marshall Islands (GMT +12:00)
14 Guam (GMT +10:00)
15 Palau (GMT +9:00)
16 Micronesia (GMT +11:00)

12.) Elevation

The elevation, measured in feet. Elevation is calculated for the ZIP Code Centroid (lat/lon) using USGC data. This will not be the elevation for all areas of the ZIP Code.

13.) County FIPS

Federal Information Processing Standards code given to counties or parishes. This code simply identifies each U.S. county by its 3 digit code. Combine this with the State FIPS code to get the unique 5 digit FIPS Code.

14.) Daylight Savings

Flag indicating whether a zip code is on daylight savings.

15.) PreferredLastLineKey

This field is used to link to other Zip-Codes.com products.

16.) Classification Code

The classification type of this ZIP Code.

Code Description Includes
  Non-Unique Standard ZIP with many addresses assigned to it.
M APO/FPO Military ZIP Code Used for overseas military mail
P PO Box ZIP Code Having only Post Office boxes.
U Unique ZIP Code ZIP assigned to a single organization.

18.) Multi County Flag

Flag indicating whether this ZIP Code crosses county lines.

18.) State FIPS

Federal Information Processing Standards code given to states. This code simply identifies each U.S. state by its 2 digit code.

19.) City State Key

This field is used to link to other Zip-Codes.com products. In products such as the ZIP+4 ZIP Code Database, you can match this column to the ZIP+4 PreferredLastLineKey for City Name, City Alias Names, Abbreviations, Population, and more.

20.) City Alias Code

This field is indicates what type the City Alias name is:

Code Description
{blank} Any record that does not have any of the above codes in them is a regular non military, non business, non government, non university ZIP code.
A Abbreviation - USPS designated abbreviation of a City Alias Name (ex. "Yorktown Heights"= "Yorktown HGTS" or "Yrktwn HTS", etc.)
B Business - A specific business uses this zip code. This may be either exclusively or shared with a city. To determine if it is exclusive, look to the "Classification Code" column and if it has a "U" for Unique, it is exclusive to the particular business name in the "CityAliasName" field.
M1 Military Base - Actual U.S. military base non primary name as designated by the USPS.
M1P Military Base Primary - Primary name of U.S. military base as designated by the USPS.
M2 Non Specific Military/Consulate - Military or Consulate ZIP code which is not specifically identified to any particular military base or consulate. These are used primarily for foreign military/consulate mail.
M2P Non Specific Military/Consulate Primary - USPS designated primary ZIP code for foreign/consulate mail.
G Government - A specific government entity uses this zip code. This may be either exclusively or shared with a city. To determine if the ZIP is exclusive, look to the "Classification Code" column and if it has a "U" for Unique, it is exclusive to the particular government entity name in the "CityAliasName" field.
U University - USPS designated as a U.S. university. Not the primary record for this university.
UP University Primary - Primary record for this U.S. university as designated by the USPS.

21.) Primary Record

This column indicates the "primary" city name within a given zip code. The is designated by the U.S. Postal Service, based on mail delivery.

If you want to get only the "unique" U.S. zip codes, sort the data by this field. Your results will be all (approx.) 41,000 unique zip codes and all will be designated with a "p".

22.) City (Mixed Case)

The city name of the ZIP Code in proper case. The USPS designates cities in all uppercase (i.e. NEW YORK). The Mixed case fields turns this into proper upper and lower case letters (i.e. New York).

23.) City Alias (Mixed Case)

The city alias name of the ZIP Code in proper case. The USPS designates cities in all uppercase (i.e. NEW YORK). The Mixed case fields turns this into proper upper and lower case letters (i.e. New York).

24.) State ANSI Code

American National Standards Institute codes (ANSI codes) are a standardized set of numeric or alphabetic codes issued by the American National Standards Institute (ANSI) to ensure uniform identification of geographic entities through all federal government agencies. These standards replace the Federal Information Processing Standards (FIPS) codes previously issued by the National Institute of Standards and Technology (NIST).

This code simply identifies each U.S. state by its 2 digit code.

25.) County ANSI Code

American National Standards Institute codes (ANSI codes) are a standardized set of numeric or alphabetic codes issued by the American National Standards Institute (ANSI) to ensure uniform identification of geographic entities through all federal government agencies. These standards replace the Federal Information Processing Standards (FIPS) codes previously issued by the National Institute of Standards and Technology (NIST).

This code simply identifies each U.S. county by its 3 digit code.

26.) Facility Code

The type of locale identified in the city/state name. The facility may be a USPS facility, such as a post office, station, or branch, or it may be a non-postal place name. City/state name facility codes include the following:

Code Description
B Branch
C Community post office (CPO)
N Non-postal community name, former USPS facility, or place name
P Post office
S Station
U Urbanization

27.) City Delivery Indicator

Specifies whether or not a post office has city-delivery carrier routes:

Code Description
Y Office has city delivery carrier routes
N Office does not have city-delivery carrier routes

28.) Carrier Route Rate Sortation

Short for Carrier Route Rate Sortation and Merged 5-Digit Indicator Identifies where automation Carrier Route rates are available and where the commingling of automation and non-automation mail, including Enhanced Carrier Routes and 5 digit presort, on the same pallet or in the same container is allowed. The values are A, B ,C or D and represent the following conditions:

Code Condition
A Carrier Route rates are available (Y) and merging is permitted (Y).
B Carrier Route rates are available (Y) and merging is not permitted (N).
C Carrier Route rates are not available (N) and merging is permitted (Y).
D Carrier Route rates are not available (N) and merging is not permitted (N).

29.) FinanceNumber

A code assigned to Postal Service facilities (primarily post offices) to collect cost and statistical data and compile revenue and expense data. The state number comprises the first two positions of the finance number.

The finance number can be used to match to records in other USPS files. By sorting these files by finance number, sequence matches can be made to use other street-level address information. For example, to use ZIP+4 product to obtain ZIP+4 codes for street addresses, a 5-digit ZIP Code, last-line number, or finance number for the street address must be known. The finance number can be obtained from the City State product.

For a street address such as "123 MAIN ST, SAN FRANCISCO CA," matching to the City State product will not provide a single 5-digit ZIP Code because San Francisco has more than one ZIP Code (i.e., it is a "multi-coded city"); However, the finance number for San Francisco can be obtained from the City State product. Then, by sorting the ZIP+4 product into finance number and street-name sequence, a match can be found to provide both the correct 5-digit ZIP Code and ZIP+4 code.

30.) Unique ZIP Name Indicator

Field that specifies whether the City State Record contains the organization name for a unique ZIP Code. If this field equals "Y," the organization name will appear in the City State Name field.

31.) Primary County (Mixed Case)

The primary county or parish where the ZIP Code resides. The USPS designates counties in all uppercase (i.e. NEW YORK). The Mixed case fields turns this into proper upper and lower case letters (i.e. New York).

Copyright

Portions of data provided by and © United States Postal Service 2006. The information published by Zip-Codes.com, a company which holds a non-exclusive license from the United States Postal Service to Publish and sell CITY STATE information. The price of our products is neither established, controlled or approved by the United States Postal Service.

FAQs & Online Resources

Zip-Codes.com maintains a set of online FAQs and resources to help you make the most of your ZIP Code Database.

  1. FAQs
    https://www.zip-codes.com/zip_code_directory.asp
  2. ZIP Code Database State & Street Suffix Abbreviations
    https://www.zip-codes.com/zip-code-database-faq-abbreviations.asp
  3. ZIP Code Database USPS Business Abbreviations
    https://www.zip-codes.com/zip-code-database-faq-usps-abbreviations.asp
  4. Zip-Codes.com Developer Tools & Sample Code
    https://www.zip-codes.com/developer-tools.asp

© 2003-2018 Zip-Codes.com, All Rights Reserved.
https://www.zip-codes.com

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment