此页面仅提供英文版本,导航菜单保持你的语言。

Testing & QA · 6 min read

US Address Format in 2026: Line Order, State Codes, ZIP

The US address format in 2026: what belongs on line 1 and line 2, the city-state-ZIP line, USPS state codes, ZIP+4 rules, and the form bugs each one causes.

By Charlie Simmon ·

On this page
  1. The five-line US address block
  2. Address line 1 versus address line 2
  3. The city, state, ZIP line
  4. State, district, and territory codes
  5. ZIP and ZIP+4 structure
  6. International mail and the country line
  7. Apartment, PO box, rural route, and military addresses
  8. Questions

A US address has a fixed order: recipient, street address, optional secondary unit, then city, two-letter state, and ZIP code on one line. That is the whole format. Almost every bug in a US address form comes from moving one of those pieces, inventing a field for it, or treating the ZIP as a number instead of a string.

This guide walks the block line by line, then covers the parts that cause real incidents: state and territory codes, ZIP versus ZIP+4, military and territorial addresses, and the difference between what USPS accepts on mail and what a web form should accept. Every rule below is something you can assert in a test.

The five-line US address block

Domestic mail uses a simple block. The recipient name goes first, the street address second, the secondary unit third when it exists, and the city, state, and ZIP share the fourth line. The country line is omitted for domestic mail and added only when the item leaves the United States.

Sorting equipment reads the block from the bottom up: ZIP, then state, then city, then street. That is why the ZIP belongs on the same line as the city and state rather than on a line of its own, and why a stray line between the city and the street can break automated reading. A web form does not have to mirror the mail block exactly, but the values it stores should map cleanly onto it.

LineContentsExample
1Recipient nameDana Whitfield
2Street address or PO box1420 SW Alder St
3Secondary unit, if anyApt 7B
4City, state code, ZIPPortland, OR 97205
5Country, international onlyUnited States

Address line 1 versus address line 2

Line 1 is the delivery line: building number, street name, and any directional or street-type suffix. Line 2 is the secondary unit designator: apartment, suite, floor, room, unit, building, or department. A PO box is a delivery line when it is the delivery point, so it goes on line 1, not line 2.

The rule that prevents most defects is simple: never put two different concepts on one line. "123 Main St Apt 4" is two fields pretending to be one, and it forces every downstream consumer to re-parse. Conversely, do not put the city on line 2 because the street line ran long. If the form must cap line 1 at 100 characters, that is a UI constraint, not permission to relocate data.

  • Line 1: house number, predirectional, street name, suffix, postdirectional
  • Line 2: Apt, Ste, Unit, Fl, Rm, Bldg, Dept, followed by the identifier
  • Line 2 stays blank when there is no secondary unit; never write N/A or a dash
  • A PO box is line 1 when the box is the delivery point
  • Keep a company or attention line separate from the street line

The city, state, ZIP line

These three values belong together, comma-separated, with a single space between the state code and the ZIP. The state is always the two-letter USPS code, uppercase, with no period. "Oregon" belongs in a database region name column if you keep one, but the mail line uses OR.

The ZIP is a string. It is five digits, optionally followed by a hyphen and four more for ZIP+4. Leading zeros are real: 02134 is Boston, and an integer column stores it as 2134. If your schema already has an integer ZIP column, the migration to text is worth doing before the first New England customer, not after.

USPS prefers the city name in uppercase on mail, but a form should store mixed case and uppercase only at print time. One more reason not to validate the city against the ZIP: a single delivery area can recognize several acceptable city names, so a mismatch is common and does not make the submitted address malformed. Validate the shape of each field, render the mail block, and leave city-to-ZIP agreement to a reference dataset you have actually licensed.

ValueFormatExample
CityFree text, mixed casePortland
StateTwo uppercase lettersOR
ZIP5 digits97205
ZIP+45 digits, hyphen, 4 digits97205-2515
State plus ZIPOne space betweenOR 97205

State, district, and territory codes

The USPS publishes 50 state codes plus the District of Columbia and the inhabited territories. Forms that only list 50 states reject Puerto Rico, Guam, the US Virgin Islands, American Samoa, and the Northern Mariana Islands, which is a real conversion bug for a meaningful share of US-citizen addresses.

Use the USPS codes rather than ANSI or ISO subdivisions where they differ. The USPS code is what appears on mail, and it is what address validation services return. Do not accept full state names in the region field unless you normalize them first, and do not assume the code is always two letters for every US-adjacent territory: military mail uses AA, AE, and AP, which are not states at all.

CodeNameNotes
DCDistrict of ColumbiaNot a state; still a valid region code
PRPuerto RicoFive-digit ZIPs, 006xx to 009xx
VIUS Virgin IslandsZIPs 008xx
GUGuamZIPs 969xx; often shipped internationally
ASAmerican SamoaZIP 96799
MPNorthern Mariana IslandsZIPs 9695x
AAArmed Forces AmericasMilitary mail, ZIPs 340xx
AEArmed Forces EuropeMilitary mail, ZIPs 09xxx
APArmed Forces PacificMilitary mail, ZIPs 96xxx

ZIP and ZIP+4 structure

A five-digit ZIP identifies a delivery area, usually a group of blocks, a building, or a rural route. ZIP+4 adds four digits that narrow it to a block face, a floor of a large building, or a specific carrier route. Both are strings; the hyphen in ZIP+4 is part of the conventional presentation and should be preserved when the value round-trips through a form.

You cannot infer a ZIP range for a city from first principles, and you should not build a full ZIP-to-city table by hand. What you can assert cheaply is shape: five digits, optional hyphen and four digits, no letters, no leading country prefix. If you need existence, this site checks US ZIPs against a 40,979-row dataset, which is an existence check and nothing more.

InputValidWhy
97205YesPlain five-digit ZIP
97205-2515YesZIP+4 with hyphen
02134YesLeading zero is significant
9720NoFour digits
97205 2515NoSpace instead of hyphen in ZIP+4
97205-251NoThree digits after the hyphen

International mail and the country line

For mail leaving the United States, the country name is written in uppercase on its own final line, and the US address keeps its domestic shape above it. "USA" is acceptable on inbound international mail but the full country name is the safer choice for automated sorting.

Inside a web form the country field should also drive formatting. If a user selects Canada, the state list must become provinces, the ZIP label must become postal code, and the pattern must change. If it selects the United States, the form should reject a six-character postal code rather than truncating it. Country is not a decorative dropdown.

  • Country line goes last and in uppercase for outbound mail
  • Do not add "United States" to the middle of a domestic address
  • Changing country must reset the region field, not keep the old value
  • Changing country must re-run postal validation with the new pattern

Apartment, PO box, rural route, and military addresses

Secondary units use standard designators: APT, STE, UNIT, FL, RM, BLDG, DEPT. USPS prefers the abbreviation with a space and then the identifier, as in "STE 200". Long-form words like "Suite" are accepted but are more likely to be truncated by a 30-character line-2 limit.

Rural and highway addresses may use "RR 2 BOX 145" or a street-style number assigned by the local 911 authority. Military mail uses the AA, AE, or AP code plus a ZIP in the 340xx, 09xxx, or 96xxx range, and the city field carries the APO or FPO designation, for example "APO AE 09021". None of these should be reordered by a formatter that assumes "number then street name".

Address typeExampleGotcha
Apartment1420 SW Alder St Apt 7BUnit identifier is alphanumeric
Suite600 Congress Ave Ste 1400Do not merge into line 1
PO boxPO Box 4421Valid line 1, no street required
Rural routeRR 2 Box 145No house number in the usual sense
MilitaryUnit 2050 Box 4190, APO AE 09021AA, AE, AP are not states

Questions

What order does a US address go in?+
Recipient, street address, optional apartment or suite, then city, two-letter state, and ZIP on one line. The country line is added only for international mail.
Should ZIP+4 be required?+
No. Five digits are valid for mail and for most forms. Accept ZIP+4 when supplied, keep the hyphen, and store the whole value as text.
How many state codes are there?+
Fifty states, plus DC, plus territory codes such as PR, VI, GU, AS, and MP, plus the military codes AA, AE, and AP. A 50-item dropdown is incomplete.
Is a PO box a valid street address?+
Yes, when it is the delivery point. It belongs on line 1, and the form should not demand a street number alongside it.
Can I store a ZIP code as an integer?+
No. Leading zeros matter and ZIP+4 contains a hyphen. Store the value as a string with a length limit and validate the shape, not the numeric value.

Examples are synthetic. Do not use a generated address for identity checks, account registration, or delivery.

Reference standards

Read next

All guides