I am looking to map one state based on zip codes (I have associated quantitative data that I am planning to join in QGIS).

I see that the Census TIGER shapefiles have an option for zip codes, but I don't see any associated state-based column that would allow for me to select a single state.

Can anyone could confirm whether it has state information, or has another source I can refer to, or does anyone have a spreadsheet that separately links zip code to state?

  • which state are you using? Commented Jan 4, 2017 at 20:37

3 Answers 3


From the ZCTA brochure

ZCTAs follow census block boundaries but are independent of all other statistical and governmental entities, therefore ZCTAs frequently cross the boundaries of other geographic boundaries. In addition, ZCTAs may occasionally cross state boundaries.

That said, if you're using , you can accomplish this like this.

SELECT zcta.gid                  
FROM census.zcta
JOIN census.state AS s
  ON ST_Intersects( s.geog, zcta.geog )
WHERE s.name = 'Texas'; -- or whatever name you want.

Of course, TIGER is a beast. The Texas 2016 polygon has 58,569 points. You may want to ST_Subdivide first. I wouldn't even meaningfully try to do this in QGis. It's too much of a bear of a query.


See: Determining which US zipcodes map to more than one state or more than one city?

The USPS does not define zip code boundaries spatially (some campuses, offices, etc. have a zipcode unique to them). They can cross city, county, and state boundaries.

  • slightly different question though. Commented Jan 4, 2017 at 19:33
  • I agree it's slightly different, but it may help you understand why there is not a state assigned to each zipcode.
    – MaryBeth
    Commented Jan 4, 2017 at 19:45

As per Census data products, they offer Relationship files that provide a link from ZIP code geography to other Geographies (including State).

Keep in mind, ZIP Code Tabulation Areas (ZCTAs)

ZIP Code Tabulation Areas (ZCTAs) are generalized areal representations of United States Postal Service (USPS) ZIP Code service areas.

The USPS ZIP Codes identify the individual post office or metropolitan area delivery station associated with mailing addresses. USPS ZIP Codes are not areal features but a collection of mail delivery routes.

The 2010 ZIP Code Tabulation Area (ZCTA) Relationship files provide simple relationships between the 2010 ZCTAs and other 2010 Census tabulation geography: counties, county subdivisions, places (incorporated places and census designated places), census tracts, metropolitan and micropolitan statistical areas, New England city and town areas (NECTAs), and congressional districts. From these files, data users may determine which ZCTAs exist within the other geographies and vice versa.

The ZCTA relationship files are nation-based comma-delimited ASCII files and include all 50 states, the District of Columbia, and Puerto Rico.

These files represent intersections of geography only. For instance, for the ZCTA to place relationship file, a unique combination of ZCTA and place FIPS code must exist for a record to be included in the file. Areas where the Census Bureau has delineated a ZCTA, but no place exists, are considered remainder records and are not included in this file. Situations where no ZCTA exists or where there is neither a ZCTA nor a place are also excluded from this file. The same logic applies to all other relationship files. However, data users should be aware that the totals given for the ZCTA or the geographic entity are full totals as published for the 2010 Census, therefore, data users should note that summing the part record totals may not match the totals for the ZCTAs and/or the related entities.

You can view the ZIP code within the State column as a reference.

enter image description here

Also, you can use this A Free Zip Code Database + Latitude and Longitude that provides a download to look up zip codes by state as well.

The Census Bureau also provides an animation ZIP Code Tabulation Areas (ZCTAs) Delineation Animation "The animation below explains how we used census blocks to create the 2010 ZIP Code Tabulation Areas (ZCTAs)"

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.