Key takeaways
- Write city, two-letter state abbreviation, and ZIP Code on one line when possible
- Use at least one space between each element; USPS prefers two spaces before the ZIP Code
- Store ZIP and ZIP+4 values as text so leading zeros and hyphens survive
- A plausible city-state-ZIP combination still needs an authoritative lookup when accuracy matters
Authorship and review
Read our editorial and review principles- Written by
- Random Address Generator Editorial Team
- Reviewed by
- US Address Data Review Team
- Latest substantive update
- Published a guide to the US city-state-ZIP line, two-letter state abbreviations, ZIP+4, and text storage.
The standard city, state, ZIP order
The final domestic line begins with the city, followed by the two-character state abbreviation and the ZIP Code or ZIP+4. USPS Publication 28 requires at least one space between the elements and prefers two spaces between the state and ZIP Code for mailing output.
Commas are familiar in prose, but they are not required in a standardized mailpiece address. A form can display Boston, MA 02108 while producing BOSTON MA 02108 for a label.
Use the two-letter postal abbreviation
The state field should store the official two-letter abbreviation used for mail, such as MA, TN, or CA. Do not create abbreviations by taking the first two letters of a state name; that turns Massachusetts into MA correctly by luck but fails for many others.
A select menu can reduce typos, but it must include the District of Columbia and supported US territories when the product serves them. Keep the display name and stored code as separate values.
| User-facing name | Postal code | Do not infer as |
|---|---|---|
| California | CA | CL |
| Massachusetts | MA | MS |
| Mississippi | MS | MI |
| District of Columbia | DC | WA |
| Puerto Rico | PR | PU |
ZIP Code and ZIP+4 are text values
A five-digit ZIP Code can begin with zero. ZIP+4 adds a hyphen and four digits. A numeric column strips the leading zero and cannot preserve the display hyphen, so use text in databases, spreadsheets, and APIs.
Do not add four random digits to create a realistic-looking ZIP+4. The add-on identifies a more specific delivery segment and must come from an authoritative source when it is used as a real mailing value.
| Input | Normalized display | Test |
|---|---|---|
| 02108 | 02108 | Leading zero remains |
| 381881001 | 38188-1001 | Add the hyphen only after validating nine digits |
| 38188-1001 | 38188-1001 | Preserve a valid hyphen |
| 3818 | Reject or request correction | Do not pad a short ZIP Code |
City names should come from the postal address source
People may use a neighborhood, municipality, or familiar city name that differs from the preferred postal city. Do not replace it with a guessed value based only on the ZIP prefix. When consistency matters, compare the full address with USPS ZIP Code Lookup or an authorized validation result.
Keep multiword and punctuated names intact in the raw record. A city field is text, not a single token.
- Accept spaces in city names
- Preserve supported punctuation and Unicode
- Do not assume a ZIP Code belongs to only one familiar city label
- Do not derive a full address from city and ZIP alone
Last-line test cases that catch real bugs
Keep a leading-zero ZIP, a ZIP+4, a multiword city, Washington DC, and a territory code in regression tests. Also test what happens when a form receives a full state name but the API expects the two-letter code.
Format checks can prove that a value has the right shape. They cannot prove that the city, state, and ZIP belong together or that the delivery point exists.
Frequently asked questions
What is the correct city, state, ZIP format?
Write the city first, then the two-letter state abbreviation, then the five-digit ZIP Code or ZIP+4 on the same line when possible.
Do I need a comma between city and state?
A comma is common in prose and forms, but USPS standardized mailing output does not require it.
Why should ZIP Codes be stored as text?
Text preserves leading zeros and the ZIP+4 hyphen. Numeric storage can silently change the value.
Can I find the state from a ZIP Code alone?
A ZIP lookup can return postal information, but do not infer or overwrite a complete address from a pattern alone. Use a current authoritative lookup when accuracy matters.
