NorthMock · Postal fields for developers and QA
US Address Format and Examples for Forms
Use the correct United States field order, postal syntax, unit handling, and browser autocomplete values when building checkout, CRM, onboarding, and test-data workflows.
US address format at a glance
USPS describes a consumer address as a recipient line, a delivery address line, and a last line containing the city, two-letter state abbreviation, and ZIP Code. USPS prefers two spaces between the state abbreviation and ZIP, while web forms should store each component separately.
Format template
[RECIPIENT NAME]
[STREET NUMBER] [STREET NAME] [APT OR STE]
[CITY] [STATE] [ZIP OR ZIP+4]
UNITED STATES
Safe format example
TEST USER
123 EXAMPLE ST APT 4B
COLUMBUS OH 43215
UNITED STATES
Format-only placeholder: This example is not verified, generated, or offered as a deliverable mailing address.
The country name belongs on its own final line when the item is addressed internationally. In a web form, keep country in a separate field even when it is omitted from the domestic display block.
Map the address into web-form fields
Do not force a complete address into one opaque string when the product needs validation, sorting, tax, shipping, or analytics by component. The autocomplete tokens below follow browser conventions and help users complete familiar fields.
| Form field | Store | Autocomplete | QA expectation |
|---|---|---|---|
| Address line 1 | Street or civic number, street name, and street type | address-line1 | Required for the conventional template |
| Address line 2 | Apartment, suite, unit, floor, building, or other secondary detail | address-line2 | Usually optional; never silently discard it |
| City | The approved or represented city value | address-level2 | Keep separate from the state |
| State / territory | Official two-letter code | address-level1 | Show code plus full name in select options |
| ZIP code | Five-digit ZIP or supported ZIP+4 string | postal-code | Use a text input, not a numeric field |
| Country | United States / US | country | Use an explicit country value for international forms |
NorthMock API and exports expose address_line, locality, region_code, postal_code, and country_code. An application that collects a separate line 2 should retain and map it according to its own contract.
US address rules that matter in software
ZIP and ZIP+4 syntax
Support five digits and, when the product needs it, a hyphen followed by four digits. A syntactically correct ZIP still needs state and address-level checks before it can be called validated.
State abbreviations
Use the USPS two-letter state or possession abbreviation. In a user interface, pair the code with the full name so choices such as MA, ME, and MD are easier to distinguish.
Apartments and suites
USPS recognizes designators including APT, STE, UNIT, and RM. Prefer the end of the delivery line, or retain the value in address line 2 when the product uses separate fields.
City and country line
Keep city, state, and ZIP together in the display format. Put UNITED STATES on its own final line for international addressing; domestic web forms should still store an explicit country code when multiple countries are supported.
Basic ZIP code syntax check
^\d{5}(-\d{4})?$
This accepts five-digit ZIP and optional ZIP+4 syntax. Store the value as text so a leading zero survives form submission, CSV export, JSON serialization, and database round trips.
US address-form QA matrix
Test normalization, error messages, copy/paste, export, and persistence independently. A passing pattern check is not evidence that an address exists or receives mail.
| Case | Fixture | Expected behavior |
|---|---|---|
| Standard ZIP | 43215 | Accept five characters and keep the value as text. |
| Leading-zero ZIP | 06103 | Preserve all five characters through storage and export. |
| ZIP+4 | 43215-1234 | Accept only when the product supports the extended format. |
| Secondary unit | APT 4B, STE 200, or UNIT 7 | Retain it on line 1 or in a dedicated line 2 field. |
| State/ZIP mismatch | Correct syntax but a ZIP outside the selected state allocation | Flag the inconsistency without claiming street deliverability. |
| DC versus Washington state | Washington city with DC, not WA | Keep city and region values semantically distinct. |
| Territory or military address | AS, GU, PR, VI, AA, AE, or AP where supported | Do not reject valid non-state two-letter choices by assumption. |
Format, regional consistency, and deliverability are different checks
Syntax validation
Checks character order, separators, length, and allowed codes. It can reject malformed input but cannot identify a specific building.
Regional consistency
Checks whether a ZIP code or prefix is allocated consistently with the selected state. NorthMock applies this boundary to its regional pools.
Postal validation
Requires current postal reference data and address matching. USPS or Canada Post guidance—not a random generator—defines mailing standards.
Deliverability and occupancy
Require additional, current evidence. A formatted or generated address must never be treated as proof that mail can be delivered or that a person lives there.
US address-format questions
Is the country line required?
Use UNITED STATES on its own final line for international addressing. A domestic display block may omit it, but multi-country applications should still store US explicitly.
Should ZIP code values be stored as numbers?
No. Store them as strings. US ZIP codes may begin with zero, and ZIP+4 includes a hyphen.
Does correct formatting prove the address is valid?
No. Formatting, regional consistency, postal matching, deliverability, and occupancy are separate claims. This guide and NorthMock test records do not prove delivery or residency.
Can I generate a safe test record in this format?
Yes. Open the US address generator, choose a region, and generate one or up to 25 records with separate form fields.
Primary sources and related NorthMock tools
This guide translates postal and public-sector design guidance into practical QA checks. Review the source documents directly when preparing real mail or designing a production address-validation policy.