Start with the form’s own labels

A form often separates the street address from city, state and ZIP. Put the house number and street name in Address Line 1. If the form provides a separate apartment or suite field, put that detail there. Address Line 2 commonly holds this extra information, but individual forms can use different labels. Follow the instructions on the form you are completing.

The example below illustrates a split form. The street and apartment are invented. Boston, MA and 02108 illustrate a location combination; they do not verify the fictional street.

A fictional form example — not a delivery address
Address Line 1: 128 Example Lane
Address Line 2: APT 4B
City: Boston
State: MA
ZIP code: 02108
Country: United States

Keep the apartment information when there is one

An apartment or suite number can distinguish one destination from another in the same building. USPS recommends placing a known unit designation at the end of the delivery-address line on a mailpiece. APT and STE identify apartments and suites; the postal guidance concerns the printed address, rather than mandating a website field called Line 2.

In a prototype, try both a blank second line and a second line containing APT 4B. When the form combines the lines into a label, check that it preserves the unit and does not print an empty gap when Line 2 is blank. Do not invent an apartment to satisfy an optional field in a real order.

Copy city, state and ZIP as one group

In AddressSample, these three location fields come from the same source record. Copying the city from one result and the ZIP from another breaks that relationship. Keep the ZIP as text so that a value such as 02108 remains five characters.

For a form test, check the stored value as well as the visible label: the state control may store MA while displaying Massachusetts. For actual delivery, confirm the recipient’s full address using the carrier or postal service rather than treating a sample as verification.

A small test plan you can repeat

Generate a US sample, copy its street into Line 1 and keep city, state and ZIP together. Test an optional blank Line 2, then a fictional unit value. Save and reload the form; confirm that the unit and leading zero remain intact. Finally, inspect the full address in the confirmation screen or export.

AddressSample creates test profiles and fictional delivery details. It cannot receive parcels or establish a person’s residence. The current US dataset covers the 50 states and Washington, DC; it is not a complete directory of US postal destinations.

Sources and further reading

Data sources ↗