Blog

An Oregon ZIP Code With 90% of Its Land in California? Untangling US ZIP Code Boundaries

Is it safe to auto-fill City and State from a ZIP code? Counting all 33,791 ZCTAs in the Census Bureau's 2020 relationship files, 10,180 cross a county line and 137 cross a state line. Why an Illinois village sits inside a Missouri ZIP, and which address-form fields should never be locked.

Diagram splitting the five digits of ZIP code 63673 into Missouri, with 79.7% of the land area, and Illinois, with 20.3%
The post office for ZIP code 63673 is in St. Mary, Missouri. In the Census Bureau's ZCTA, about one-fifth of the area's land lies in Illinois.
Contents

When you enter a shipping address on an American shopping site, City and State are often filled in the moment you finish typing the five-digit ZIP code. If I were writing that feature, I would start by looking up the post office location for those five digits. 97635 gives “New Pine Creek, OR”, a small town in Oregon. Nothing difficult so far.

Open the area for 97635 in the US Census Bureau’s 2020 relationship files, though, and 92.8% of its land area lies in Modoc County, California. Lake County, Oregon, has only the remaining 7.2%. The town itself straddles the state line, and the Census Bureau registers a settlement named “New Pine Creek” in both California and Oregon.

As a mailing address, “New Pine Creek, OR 97635” probably gets the letter delivered. The trouble starts when that State field is saved as “the state this person lives in” and used to calculate sales tax or insurance premiums, or to decide which states you cannot ship to. When I looked into Japanese postal codes that cover several addresses, I found seven-digit codes that pin down the address only partway through the chōiki, the neighbourhood-level locality name that follows the city in a Japanese address. In the United States, the part a code cannot pin down extends all the way up to the state.

What the five digits were designed to decide in 1963

ZIP codes began on July 1, 1963. ZIP stands for Zone Improvement Plan, and under the previous system a letter was reportedly sorted at about 17 places before it arrived. Postal zone numbers themselves are older: by 1943, numbers called “zones” were in use in 124 urban areas. Library of Congress blog (2013)

According to the 1963 Post Office annual report quoted in the same post, the first digit stands for one of ten large regions of the country, the second for a state (or part of a populous state), and the third for a major sorting destination within the state. The facility identified by those three digits is a Sectional Center, and 553 of them were designated across the country at the time. The last two digits indicate a delivery unit of a large city post office, or a post office served by the sectional center. The Smithsonian National Postal Museum gives much the same explanation and notes that a single five-digit code can stand for as many as 10,000 delivery points. National Postal Museum, “50 ZIPpy years”

Laid out like this, the question the five digits answer becomes clear: “Which facility should this piece of mail go to next?” Even the second digit’s state can be read as a matter of sorting convenience, grouping mail by state. Nobody copied the map of state lines into numbers. In 1983, ZIP+4 added four more digits at the end. USPS historical material, “Mr. ZIP”

The Census Bureau puts it more directly. USPS assigns ranges of ZIP codes to local post offices, and the post offices assign them to delivery routes. A ZIP code is a collection of addresses, that is, points, and cannot be drawn on a map as it is. Census Bureau, “ZIP Code Tabulation Areas (ZCTAs)”

ZCTAs: how ZIP codes got an area

To put statistics on a map, the Census Bureau builds ZCTAs (ZIP Code Tabulation Areas, pronounced “zik-tahs”). Each census block, the smallest unit of the census, is assigned the ZIP code used by the most addresses in it if the block contains housing, and blocks with the same code are joined into an area. So every ZCTA boundary follows census block boundaries, and a ZCTA can have detached pieces. Not every ZIP code has a ZCTA either. Codes used only for PO boxes, or only by a particular company or organization, may or may not become ZCTAs. Census Bureau explanation of ZCTAs

The important point here is that census blocks are drawn to fit inside county and state boundaries. If a ZCTA crosses a county or state line, it is not a drafting error. Either the most common ZIP code among addresses in a block on the other side of the line was that code, or a block with no housing was included in the area.

Counting which of 33,791 ZCTAs cross county and state lines

I used the Census Bureau’s “2020 ZCTA to County Relationship File”. It has one row for each part where a ZCTA overlaps a county, with the land and water area of that part. I dropped overlaps that are water only and counted only pairs that share land. The scope is the 33,791 ZCTAs in the 50 states, the District of Columbia and Puerto Rico. Census Bureau 2020 ZCTA relationship files

Whether a ZCTA crosses a county or state line was graded by the share of land held by the county (or state) with the second-largest land area.

Land share of the second county or state Crosses a county line Crosses a state line
Any at all 10,180 137
Over 1% 9,441 117
Over 10% 6,266 71
Over 25% 3,359 31

For counties, about 30% of ZCTAs extend into two or more. 137 cross a state line, and in 31 of them the second state holds more than a quarter of the land. Keep in mind that these are shares of area, not of population or addresses, so you cannot say “137 codes put residents in the wrong state”. Where mountains or farmland make up most of an area, a large share of land may hold very few people.

Even so, the table is enough to show where logic that picks one state from five digits breaks down. Here are a few.

  • 97635 (New Pine Creek, OR): Modoc County, California, 92.8%; Lake County, Oregon, 7.2%
  • 89439 (Verdi, NV): Washoe County, Nevada, 74.3%; Sierra County, California, 25.7%. A settlement named Verdi is registered on both sides of the state line as well
  • 42223 (Fort Campbell, KY): Montgomery County, Tennessee, 55.1%; Christian County, Kentucky, 44.9%

The ZIP code for the Fort Campbell Army post is in Kentucky as far as the post office location goes. Yet more than half of the area’s land is in Tennessee, and the place relationship file shows that 26.9% of it falls inside the city of Clarksville, Tennessee.

An Illinois village west of the river

Of the 137 codes that cross a state line, the easiest one to explain was 63673. Its post office is in St. Mary, Missouri. The area spans Ste. Genevieve County (49.5%) and Perry County (30.2%) in Missouri and Randolph County (20.3%) in Illinois. The place relationship file lists the village of Kaskaskia, Illinois, inside this ZCTA.

Kaskaskia was the first state capital when Illinois became a state in 1818. According to an article from the National Endowment for the Humanities (NEH), it is now an island on the west side of the Mississippi River that can only be reached through Missouri, with fewer than 25 residents. NEH, “When Illinois Joined the Union, Its Capital Was Kaskaskia”

Kaskaskia originally stood east of the river, on the Illinois mainland. According to St. Louis Public Radio, 37 years after a flood in 1844, another flood cut a new channel for the Mississippi and the old town went under. The state line stayed on the old riverbed, and Kaskaskia became the only part of Illinois west of the Mississippi. The bridge connecting it to the mainland is in St. Mary, Missouri. St. Louis Public Radio (2010)

I could not find any USPS document explaining how this ZIP code was assigned. But remember what the five digits were for in the first place, and it makes sense. If you are carrying mail to the island, the natural way in is from the Missouri side, where the bridge is. ZIP codes follow the path the mail takes, while the state line follows where the river ran around 1881. With two separate histories, it was only to be expected that they would not line up.

Sixty percent of “Beverly Hills 90210” is the City of Los Angeles

The same thing happens to the City field, not just State. 90210, which also gave a TV drama its title, is known in the mail as a Beverly Hills code. Yet looking at land area in the ZCTA-to-place relationship file, the City of Beverly Hills accounts for 37.8% and the City of Los Angeles for 60.5%.

This does not mean the address is wrong. USPS Publication 28, the postal addressing standard, strongly recommends using a city name approved in the USPS City State file on the last line of an address. The City on a mailing address is “a place name you may use for mail”, not a field that says which municipality the address belongs to. USPS Publication 28, “221 City Names”

Counted nationwide, 6,836 ZCTAs contain two or more incorporated (and functioning) cities or towns. Logic that fills in one city name from five digits can tell you whether the name is usable for mail, but not which city a resident pays taxes to or votes in.

Tax rates cannot be determined from a ZIP code

In the United States, the place where a mistaken address most easily turns into money is sales tax. Rates differ not only by state but by county, city and special district. The Washington State Department of Revenue, in guidance for online sellers, states plainly that five-digit ZIP codes do not correspond exactly to tax rates or taxing jurisdictions. The state has about 16 different rates and about 355 taxing jurisdictions, and calculating from the address or ZIP+4 is the most accurate method. Washington State Department of Revenue guidance

The Tennessee Department of Revenue likewise tells users to look up rates by “street address and city” or “street address and ZIP code”. The assumption is that a ZIP code alone is not enough. Tennessee Department of Revenue, “Helpful Hints for Tax Rate Lookups”

Nothing changes when selling to the US from abroad, as from Japan. If you pass a shipping address to a payment service’s tax calculation, pass the full address including the street address, not just the ZIP code. If you look up a rate table yourself, use a mechanism that determines the taxing jurisdiction from the address rather than the five digits.

Back to the address form

There is no need to stop filling in fields from the ZIP code. When the goal is a mailing address, offering the USPS-approved city name and state as candidates is the right kind of help. What should change is how far the result is treated as final.

  • Fill in City and State from the ZIP code as suggestions the user can change. When several city names are valid for the same ZIP code, let the user choose.
  • Do not decide county, municipality, tax rate, shippability or state-of-residence conditions from the ZIP code alone. Determine them from the full address including the street address.
  • If the auto-filled state and the user’s input disagree, ask instead of silently overwriting. A form that changes the “IL” a Kaskaskia resident entered back to “MO” has succeeded at looking up the ZIP code. Where it went wrong is in letting the program decide where the state line is.

If it were my form, I would put 63673 and 97635 into the tests. Typing the ZIP code shows a suggestion in the State field, you can change it to Illinois or California and still save, and tax and shipping decisions use the edited address. If it gets that far, it passes.

Reproduce the nationwide count yourself (Python)

From the Census Bureau 2020 ZCTA relationship files, download tab20_zcta520_county20_natl.txt (relationship to counties) and tab20_zcta520_place20_natl.txt (relationship to places), put them in the same folder as the code below, and run it. Both files are dated December 9, 2021, and I checked the results with Python 3.13.18. The SHA-256 of the county file is 3ed41278d637dc249e0323306f68be8a6c234e3090f4de88ef328dee71aeaaaf and of the place file 698a5dad71ed419411677d0ffd8ecd9331067f59c472cdd239b92c12f698285d.

The count uses land area (AREALAND_PART) and ignores water-only overlaps. The first two digits of a county code are the state FIPS code. Among places, incorporated cities and towns are those whose CLASSFP starts with C, and only those with FUNCSTAT A (active) were counted.

import csv
from collections import Counter, defaultdict

def read(path):
    with open(path, encoding="utf-8-sig", newline="") as f:
        return [r for r in csv.DictReader(f, delimiter="|") if r["GEOID_ZCTA5_20"]]

def shares(parts):
    """Return land-area shares, largest first"""
    total = sum(parts.values())
    return sorted(((v / total, k) for k, v in parts.items()), reverse=True)

county_rows = read("tab20_zcta520_county20_natl.txt")
by_county = defaultdict(Counter)
by_state = defaultdict(Counter)
names = {}
for r in county_rows:
    land = int(r["AREALAND_PART"])
    if land == 0:
        continue  # skip water-only overlaps
    zcta, county = r["GEOID_ZCTA5_20"], r["GEOID_COUNTY_20"]
    by_county[zcta][county] += land
    by_state[zcta][county[:2]] += land
    names[county] = r["NAMELSAD_COUNTY_20"]

print("ZCTAs", len({r["GEOID_ZCTA5_20"] for r in county_rows}))
for threshold in (0, 0.01, 0.10, 0.25):
    def crosses(groups):
        return sum(len(s) > 1 and s[1][0] > threshold
                   for s in map(shares, groups.values()))
    print(f"second land share>{threshold:.0%}", "county", crosses(by_county),
          "state", crosses(by_state))

for zcta in ("97635", "89439", "42223", "63673"):
    print(zcta, [(f"{p:.1%}", names[c], c[:2])
                 for p, c in shares(by_county[zcta])])

place_rows = read("tab20_zcta520_place20_natl.txt")
by_place = defaultdict(Counter)
for r in place_rows:
    if r["GEOID_PLACE_20"] and int(r["AREALAND_PART"]) > 0:
        by_place[r["GEOID_ZCTA5_20"]][
            (r["NAMELSAD_PLACE_20"], r["GEOID_PLACE_20"][:2],
             r["CLASSFP_PLACE_20"], r["FUNCSTAT_PLACE_20"])] += int(r["AREALAND_PART"])
zcta_land = {r["GEOID_ZCTA5_20"]: int(r["AREALAND_ZCTA5_20"]) for r in place_rows}

def incorporated(key):
    return key[2].startswith("C") and key[3] == "A"  # active incorporated place

print("ZCTAs with 2+ incorporated places",
      sum(len([k for k in places if incorporated(k)]) > 1
          for places in by_place.values()))
for zcta in ("90210", "42223", "63673", "97635", "89439"):
    print(zcta, [(f"{v / zcta_land[zcta]:.1%}", *k[:2])
                 for k, v in by_place[zcta].most_common()])