A test address is not just filler text in a form. It has to survive the same validations a real customer's address does, otherwise your test proves nothing — or worse, passes while production fails. This guide covers what breaks, what to test, and how to get addresses into your test suite.
Why hand-made test addresses fail
123 Main St, Test Test, asdf, CA 90210 — every one of these gets rejected somewhere, and each rejection hides a real bug behind a fake error. A made-up house number fails street-level verification; a placeholder ZIP fails tax lookup; a state name instead of a code fails the state field. You end up debugging your test data instead of your code.
Who uses a US address generator — six common jobs
- Checkout and payment flows. Stripe, PayPal and Adyen test modes still validate the address and compute tax by ZIP. A house number that does not exist fails address-verification checks or returns a zero tax rate, which hides bugs until production.
- Signup and profile forms. Address autocomplete and required-field validation behave differently for a real ZIP — New Hampshire ZIPs start with zero (
03101), New Jersey and Maine too — than for a placeholder like12345. - Shipping-rate and zone tests. Carriers price by ZIP, so testing a single state hides zone logic errors across continental and non-contiguous destinations.
- Database seeds and test fixtures. Ten rows spread across states and ZIPs beat repeating
John Smith, 123 Main Stin every seed file. - Address-format reference. Field order, two-letter state abbreviations, quadrant directionals and ZIP+4 formatting for documentation, mockups and support scripts.
- Privacy-conscious demos. Screenshots and recordings that show a plausible US address without exposing a real customer's home.
The five validations a test address has to survive
- Address verification (AVS). Payment providers and shipping APIs check that the house number exists on the street and that the ZIP matches the city and state.
- Sales tax by ZIP. Tax engines resolve a rate from the address. A non-existent ZIP often returns
0%, so a broken tax integration looks like a zero-tax state. - Shipping zones and rates. Carriers price by ZIP and zone. Testing one state only means your zone logic is untested for every other zone.
- Phone format. Signup forms check the area code against the ZIP or against NANP rules;
555-1234and000exchanges fail. - Autocomplete and normalization. City/state/ZIP consistency is what address autocomplete verifies; a mismatched trio silently fails the lookup.
Getting addresses into your tests
- One at a time, by hand: pick a state on the home page and copy individual fields or the entire address.
- Batch of 5 or 10: the random US address generator exports CSV or JSON for seed files.
- State-specific cases: each state has its own page — New Hampshire for leading-zero ZIPs, Oregon and Delaware for 0% sales tax, Nevada and Idaho for county-level E911 fees, Wyoming and New Mexico for LLC filing cases.
- Deterministic fixtures: commit a fixed CSV or JSON file instead of generating on every run. The field reference and sample rows are in US address test fixtures.
A ten-minute test checklist
- Signup form: submit a leading-zero ZIP (
03101) and confirm the stored value keeps the zero. - Checkout: run one order per tax region and confirm the tax rate is not silently
0%. - Shipping: one address per state and confirm the zone or rate changes where it should.
- Phone field: submit an area code that does not match the ZIP and confirm the form rejects it as you expect.
- International: submit a UK or Canadian address and confirm the US-only form rejects it with your own error, not a crash.
- Copy/paste: paste a full address string and confirm your parser splits house number, street, city, state and ZIP correctly.
What StateAddress guarantees — and what it does not
Every address is a real OpenStreetMap address point matched by the U.S. Census Bureau Geocoder, paired with a NANP-valid phone number that uses the ZIP's real area code, plus ACS income, time zone and utility data. What it does not do: generate ZIP+4 suffixes, cover states outside the 19 listed, or produce deliverable mailing addresses. If your test needs a specific state we do not cover, tell us — coverage grows state by state, and a state only ships after its addresses pass the Census match.
Keep your test data boring
The best test address is one you never have to think about again: the same twelve rows, the same ZIPs, committed to the repo. Generate once, freeze the file, and refresh it only when you add a state or a scenario — that way a failing test always means a failing product, not flaky data.