All posts

How to Generate Fake Addresses for Testing (the Right Way)

July 21, 2026 · DevTools

address generator
test data
fake address
postcode
qa

Every checkout form needs an address. Every shipping integration, every KYC screen, every profile page. When you're building it, you reach for sample data — and the wrong sample data causes three predictable problems. The form rejects it because the postcode is the wrong shape. The CI seed file looks obviously fake and stops being useful. And, occasionally, you accidentally combine a real street with a real postcode and ship a "test" record that points at someone's actual home.

A good address generator solves all three by emitting realistic fields per country in the formats those fields actually use. Try every example below in the Address Generator.

Why country matters

Address conventions differ in four places that break validation:

  • Postcode position — US zip codes sit after the state (New York, NY 10001), UK postcodes come before the city (London SW1A 1AA), German PLZ is a 5-digit prefix that drives regional sorting (10115 Berlin).
  • Postal code shape10001 (US), SW1A 1AA (UK, with mandatory outward/inward split), A1A 1A1 (Canada, alternating letter/digit), 10115 (Germany, 5 digits), 75001 (France, 5 digits), 100-0001 (Japan).
  • Street order — most countries put the house number before the street name (123 Main St). Some put it after (Calle Mayor 12).
  • Region inclusion — US addresses use a 2-letter state code. UK addresses use a county or post town. Japanese addresses go from largest to smallest region.

The generator knows these conventions for 21 countries and produces addresses whose fields are in the right order and whose postcodes match the local regex.

Step 1: Pick a country

The country picker selects the convention. Switching country changes both the field order and the postcode pattern, so you can preview how your form behaves under different locales.

Step 2: Pick the output format

Four formats cover the common cases:

  • Single line123 Main St, New York, NY 10001, United States. Useful for paste-into-form testing.
  • Multi-line — one field per line, suitable for printing on a label or rendering in a paragraph.
  • JSON — structured object { number, street, city, region, postalCode, country }. Designed to be piped straight into a seed script or a Mongo/Postgres insert.
  • HTML — wrapped in <address> tags, ready for a placeholder profile or invoice template.

Step 3: Set the count and generate

You can produce up to 50 addresses per click. With JSON format, the output is a list of objects you can copy and feed to a seeder:

[
  {
    "number": "4281",
    "street": "Maple Ave",
    "city": "Brooklyn",
    "region": "NY",
    "postalCode": "11215",
    "country": "United States"
  },
  {
    "number": "97",
    "street": "Lakeshore Dr",
    "city": "Chicago",
    "region": "IL",
    "postalCode": "60611",
    "country": "United States"
  }
]

Step 4: Validate a postcode

The Validator tab checks a single postcode against the country regex. Paste SW1A 1AA and pick United Kingdom — it's valid. Paste SW1A1AA without the space and pick United Kingdom — the validator still accepts it because most UK integrations tolerate the no-space form. Paste the same string under Canada and it's rejected, because SW1A 1AA does not match the Canadian pattern.

This is the same logic your form should implement when accepting user input: a regex per country, plus the option to strip whitespace before matching.

Deeper dive: what's "realistic"

The street names come from common lists per country (Maple, Oak, Lakeshore, Calle Mayor, Rue de la Paix, Bahnhofstraße). The cities are real, the regions are real, the house numbers are randomized, and the postcodes are checked against the local pattern. The combination is statistically unlikely to be a real address — but that's the test-data contract: valid in shape, fictional in combination.

Everything stays in your browser

The generator runs entirely client-side. Nothing is uploaded, nothing is logged. The addresses are valid in shape but do not correspond to real homes — they are test data for software development, not for bypassing any check.

Next: phone numbers in the same locale

An address without a phone number is a half-finished form. The next guide covers phone-number formats per country, E.164 vs national vs RFC 3966, and NANP area codes: read How to Generate Test Phone Numbers by Country or jump straight into the Phone Number Generator.