Address line 1 vs. line 2: a field model that keeps details
Decide where street, building, floor, and unit details belong without treating line numbers as universal rules.
The labels do not define a global schema
“Address line 1” and “Address line 2” are common interface labels, not a complete international address model. Keep country, locality, region, postal code, and recipient in separate fields where possible.
<input name="address1" autocomplete="address-line1"> <input name="address2" autocomplete="address-line2"> <input name="city" autocomplete="address-level2"> <input name="postalCode" autocomplete="postal-code">
Keep secondary details recoverable
An apartment, suite, floor, building, or care-of line may matter for delivery. USPS Publication 28 places secondary unit designators on the delivery address line or the line immediately above when space requires. Follow each destination country’s conventions.
123 Main St Apt 4B Boston, MA 02108 Structured: line1="123 Main St" · line2="Apt 4B" · city="Boston" · region="MA" · postal="02108"
Map fields at the boundary
Store structured fields internally, then format them for labels, APIs, and localized forms. Preserve the original user input if normalization is needed so support staff can diagnose a rejected value.
Test overflow and missing units
Include long building names, a missing unit, unit values with letters, and pasted multiline input. A single-line checkout layout should still expose the complete value to assistive technology and the submitted payload.