Keep Apartment Details in a Shipping Form
Admin ·
When a checkout truncates a second address field, an apartment number or part of the locality can disappear. Test both layouts with the form's actual limits and keep the source address available for correction.
Address Line Splitter for Shipping Forms
Keep Apt 5B together across three fields
Select Load the 5B example to enter 27 Cedar Avenue Apt 5B, Harbor City, NY 10011. The example enables unit grouping and sets the three limits to 25, 20 and 15. Select Split addresses.
The status is 1 fit, with no overflow. The first line holds the street, the second starts with Apt 5B, and the third holds the state and ZIP text. Open shipping-addresses.json and check that source is unchanged, fields contains the three lines shown below and overflow is empty.
| Field | Exact text | Characters |
|---|---|---|
| Line 1 | 27 Cedar Avenue | 15 of 25 |
| Line 2 | Apt 5B, Harbor City, | 20 of 20 |
| Line 3 | NY 10011 | 8 of 15 |
Recheck the same address in a shorter checkout
Switch Shipping field count to Two fields and set the Line 2 limit to 15. Split addresses again. Line 2 reads Apt 5B, Harbor and the overflow reads City, NY 10011. Keep that overflow visible during review instead of truncating the export.
The tool preserves word order and packs whole words. It moves the first recognized unit label and ID together when you enable that option. Use the original address to map the street, locality and postal code to the specific fields supplied by your checkout.
Open the splitter and load the 5B exampleUSPS Publication 28, secondary address unit designators
Check the final fields against the carrier form
The limits count Unicode code points. Compare them with the destination form if it counts UTF-8 bytes or uses another length rule. The tool collapses spacing for the split, records the original line in its JSON and processes up to 500 lines locally.
For US mail, review the USPS addressing standard for secondary unit designators. The optional street-number cue looks for a number before the first comma or unit. Delivery, city and postal code checks belong with the relevant address authority or carrier.
Common questions
What happens if Apt 5B cannot fit in any secondary field?
With grouping enabled, the tool keeps the unit phrase intact in overflow along with any later pieces. Increase the field limit or check the layout offered by the carrier.
How do I check a street without a building number?
Use the carrier's rules for that address. The missing-number flag records a cue for review and can appear on addresses that follow a different local convention.
Sources and example
Put it into practice.
- Address Line Splitter for Shipping Forms
- Placeholder Address Generator
- Duplicate Line Remover
- JSON formatter