25 US Address Edge Cases Your Form Should Survive (A Test Checklist)
Published November 15, 2026 by the USA Address Generator editorial team · Testing & QA · 9 min read
Hyphenated house numbers, grid addresses, fractional numbers, streets with no suffix, units with no number: the real US address shapes that break forms and parsers, with a test value for each.
Most address forms are tested with one address: 123 Main St. Real US addresses come in far more shapes than that, every shape below is in everyday use, and each one breaks a particular kind of validation rule. This is a checklist to run against a form, a parser or a database schema before real customers find the gaps for you.
The examples are illustrative formats, not real households. Type them by hand or adapt generated records to match; the point is the shape.
House numbers that are not plain integers
The house number is the field developers most often over-validate, usually with a rule like "digits only".
| Shape | Example | What it breaks |
|---|---|---|
| Hyphenated | 123-45 67TH AVE | Digits-only checks. This is the standard form in Queens, New York, where the first part refers to the nearest cross street. |
| Hyphenated, Hawaii | 91-1020 KAMAAHA AVE | The same check. On Oahu the prefix identifies a district. |
| Fractional | 123 1/2 MAIN ST | Parsers that split on the first space and treat 1/2 as the street name. |
| Alphanumeric suffix | 12A ELM ST | Integer columns. The letter is part of the number, not a unit. |
| Grid coordinates | N6W23001 BLUEMOUND RD | Almost everything. Parts of Wisconsin use a county-wide grid where the number begins with letters. |
| Leading letters and digits | W168N8936 APPLETON AVE | Regexes that anchor on a leading digit. |
Test: store the house number as text, never as an integer, and make sure the form accepts a hyphen, a slash and letters in it.
Street names that look like something else
| Shape | Example | What it breaks |
|---|---|---|
| Numbered grid street | 842 E 1700 S | Parsers that expect a word after the directional. Common across Utah: the street is "1700 South". |
| No suffix at all | 150 BROADWAY | Rules that require a suffix from a fixed list. |
| Suffix word used as the name | 45 AVENUE C | Parsers that take the last word as the suffix and the rest as the name. |
| Directional word as the name | 200 N SOUTH ST | Logic that strips every directional it finds. |
| Two suffix-like words | 77 PARK AVE vs 77 AVENUE OF THE AMERICAS | Any attempt to abbreviate greedily. |
| Numbered highway | 3400 STATE HIGHWAY 7 or 1200 COUNTY ROAD 12 | Parsers that read the trailing number as a unit. |
| Spanish word order | 150 CALLE A | Suffix-last assumptions. In Puerto Rico the street type comes first. |
Test: do not require a suffix, and do not try to split a street line into components unless your product really needs them. If you only display and print the address, one "address line 1" field is the safer design.
Secondary units
Publication 28 lists the secondary unit designators, and they come in two kinds: those that take a number and those that stand alone.
- With an identifier:
APT 4B,STE 300,UNIT 12,BLDG C,FL 7,RM 210,LOT 14,TRLR 9,SPC 22,DEPT 500 - Without one:
BSMT,FRNT,REAR,LOWR,UPPR,PH,LBBY,OFC,SIDE
Cases worth a test each:
- A unit with no number such as
REARorPH. A rule that says "unit must contain a digit" rejects it. - The hash form,
# 3, which USPS allows when the designator is unknown. Note the space after the sign. - A unit typed on line 1, as in
500 OAK ST APT 2. This is valid USPS formatting, so do not reject it; decide whether you will move it to line 2 or leave it. - An empty line 2. Most US addresses have no unit. If the form will not submit without one, people type "N/A" and it ends up printed on a label.
- Two secondary elements, such as
BLDG 4 APT 12. Both are legitimate on one line.
Addresses with no street at all
| Type | Example delivery line | Notes |
|---|---|---|
| PO Box | PO BOX 1234 | No periods. Many carriers other than USPS will not deliver to it. |
| Rural route | RR 2 BOX 152 | Box number is required. |
| Highway contract | HC 68 BOX 23A | Same structure, different prefix. |
| General Delivery | GENERAL DELIVERY | The whole delivery line is those two words. |
| Military | PSC 1234 BOX 5678 or UNIT 2050 BOX 4190 | City is APO, FPO or DPO; state is AA, AE or AP. |
Test: a "street number required" rule fails every row of that table. If you ship with a carrier that cannot deliver to PO Boxes, say so at the point of entry rather than rejecting the address as invalid.
City, state and ZIP
- Long city names.
RANCHO SANTA MARGARITAis 22 characters, and some are longer. A 20-character column truncates silently. - Punctuation and spaces in city names:
ST. LOUIS,COEUR D'ALENE,WINSTON-SALEM,LA CAÑADA FLINTRIDGE. Apostrophes are a classic way to find an unescaped SQL string. - States that are not states.
DC, the territoriesPR,VI,GU,ASandMP, and the military codesAA,AEandAPare all valid values in the state field of a US address. A dropdown with exactly 50 entries excludes real customers. - Leading-zero ZIPs.
02134in Massachusetts,07030in New Jersey,00926in Puerto Rico. Stored as a number, they become four or three digits. - ZIP+4 in three spellings:
90210-3456,902103456and90210 3456. Accept the first two at least, and normalise to one. - A ZIP that crosses a state line. A handful do, so a rule that says "this ZIP must belong to the selected state" needs a real lookup behind it, not a prefix guess.
- A city name that differs from the municipality. The USPS city for a ZIP is the name of the post office, which is not always the town the customer says they live in. Do not reject a mismatch between your geocoder's city and the typed one.
How to turn this into tests
A checklist only helps if it runs. Three practical ways to use it:
As a table-driven unit test. Keep the shapes in one array and assert the same thing about each.
const shapes = [
{ line1: '123-45 67TH AVE', city: 'FLUSHING', state: 'NY', zip: '11365' },
{ line1: '842 E 1700 S', city: 'SALT LAKE CITY', state: 'UT', zip: '84105' },
{ line1: 'PO BOX 1234', city: 'CONCORD', state: 'NH', zip: '03302' },
{ line1: 'PSC 1234 BOX 5678', city: 'APO', state: 'AE', zip: '09499' },
{ line1: '150 CALLE A', line2: 'URB LAS GLADIOLAS', city: 'SAN JUAN', state: 'PR', zip: '00926' },
];
for (const address of shapes) {
test(`accepts ${address.line1}`, () => {
expect(validateAddress(address).ok).toBe(true);
});
}
As a round-trip test. Save each shape, read it back, and compare byte for byte. This catches integer columns, truncation and trimming in one pass, and it is the test that finds the leading-zero bug.
As bulk noise around the edge cases. Edge cases are a small share of real traffic. Seed a few hundred ordinary records from the address generator and scatter these shapes among them, so pagination, sorting and search are exercised with realistic variety.
What not to conclude
None of this means a form should accept anything. It means the validation should match what US addresses are actually like: a required delivery line, a required city, a state from the full USPS list (the 50 states, DC, the territories and the military codes), and a ZIP of five digits or five plus four. Everything stricter than that needs a specific reason. For the rules behind these formats, see the USPS formatting guide and the street suffix and unit designator reference.