Spain Address Generator
Generate Spain address-format samples with synthetic street, building and floor values, a city, a province and a five-digit postal code. Test leading zeros, accented province names and CSV/JSON round trips using a small maintained fixture set. No real delivery or identity verification is provided.
A Spanish fixture for leading zeros, floors and door notation
Use the 09692 example to catch two separate losses: a dropped postal zero and a truncated street after the unit comma. Keep the º floor marker with the synthetic unit notation during export.
Current fixture coverage: 6 selectable regions · 6 locality fixtures
- Street
Calle del Olmo 1, 1º, B- City
Canicosa de la Sierra- Region
Burgos (BU)- Postal code
09692
Expected full-address output
Calle del Olmo 1, 1º, B, 09692 Canicosa de la Sierra, Burgos, Spain
Download this record: JSON CSV
A CSV street value containing a comma must remain one quoted cell. Postal code 09692 must also remain text, even when all characters are digits.
What to check
- Compare the º marker and comma-separated floor/door text after parsing your exported CSV.
- Confirm region remains a province field rather than replacing the locality or postal string.
A change to catch in a preservation test: postalCode
- Original value
09692- Changed value
9692
A preservation test should detect this change. Test intentional normalization against a separate contract.
What this version does not cover
Six province/locality fixtures, not a nationwide directory. Floors and doors stay embedded in street; sources do not certify a synthetic premise or provide live Correos validation.
Product scope reviewed: . Fixture methods and limits
More fixtures: compare two different failure cases
These records use the live generator’s maintained fixtures and formatter. Download them, run your own save/import/export workflow, and compare the original fields. Changed values below are deliberate preservation-test mismatches, not postal-validity judgments.
Keep the leading zero in Barcelona 08002
- Street
Calle del Olmo 1, 1º, B- Locality / region / postcode
Barcelona · Barcelona (B) · 08002
Change a preservation test should detect: postalCode
- Original
08002- Changed
8002
Keep Madrid floor/door text after the comma in one field
- Street
Calle del Olmo 1, 1º, B- Locality / region / postcode
Madrid · Madrid (M) · 28014
Change a preservation test should detect: street
- Original
Calle del Olmo 1, 1º, B- Changed
Calle del Olmo 1
Download both cases: JSON · CSV
Sources for the expanded fixture pool
- GeoNames postal data · CC BY 4.0 — Madrid / 28014; Barcelona / 08002; Sevilla / 41001; Marbella / 29601
Selected locality/postcode data: GeoNames, curated for these tests; license: CC BY 4.0.
GeoNames supports the added locality/postcode examples. Calle del Olmo, house numbers and floor/door values remain synthetic; no live Correos validation is performed.
Fixture-source review:
Spain: Supported regions and locality samples
Six province/locality fixtures are maintained. GeoNames rows support Madrid, Barcelona and Sevilla additions and the Marbella correction to 29601; this is not a live Correos service.
The current generator uses the following selectable fixtures:
Toledo (TO)
Toledo · 45012
Málaga (MA)
Marbella · 29601
Burgos (BU)
Canicosa de la Sierra · 09692
Madrid (M)
Madrid · 28014
Barcelona (B)
Barcelona · 08002
Sevilla (SE)
Sevilla · 41001
Spain: Address structure and practical checks
Postal-code handling
Spanish postal codes are five digits in these fixtures. Keep leading zeros by storing them as strings.
Address fields
Retain accents and floor or unit notation in the street field. Check that the selected province and locality survive copy and export.
Scope of these samples
These are synthetic format examples, not verified delivery addresses or real identities. A listed region does not mean that every city, street or building there is covered.
Country-specific test checks
Postcode, city and province are separate
The UPU Spain guide places a five-digit postcode before the locality and lists province separately. The original format examples include Toledo / 45012 and Canicosa de la Sierra / 09692. Attributed GeoNames rows support Madrid / 28014, Barcelona / 08002 and Sevilla / 41001; Marbella was corrected to 29601 using the Málaga province row. Marbella belongs to the Málaga fixture: do not replace the city with the province name.
Street, house number and floor
The synthetic line Calle del Olmo 12, 3º, B illustrates a street followed by house number and floor/door information. Names and numbers are generated test values, not validated premises. The full-address preview separates street, postcode/city, province and Spain with commas; an actual mailing label requires its own line layout.
Test zeros, accents and CSV quoting
Select Burgos to generate a 09692 record, then copy, save and export it. Check that the postcode remains a five-character string rather than 9692. Select Málaga to check the á character and º in the street line. Import CSV with a real CSV parser because the street contains commas. Six city/postcode fixtures are covered, not a national delivery database.
Worked example: a leading zero and embedded commas
Input: street = Calle del Olmo 12, 3º, B; postalCode = 09692; city = Canicosa de la Sierra; province = Burgos. Expected preview: Calle del Olmo 12, 3º, B, 09692 Canicosa de la Sierra, Burgos, Spain. On CSV import, keep the street in one field and set the postcode column to text. Fail if 09692 becomes 9692 or the commas split the street into additional columns. This is a synthetic fixture, not a verified building.
How this page was checked · 2026-11-04
What we checked
- Postcode, city and province are separate
- Street, house number and floor
- Test zeros, accents and CSV quoting
- Worked example: a leading zero and embedded commas
Primary references
Data boundary: Format references do not certify this synthetic record for delivery. Read the data methodology and editorial standards
FAQ
How many Spanish fixtures are available?
There are six province/locality examples. Additions and the Marbella postcode correction use attributed GeoNames rows; this is not complete national coverage.
Are floor and door separate fields?
No. Their synthetic notation is embedded in street, so importers must not drop everything after the comma.
Are these current Correos allocation results?
No. Historical UPU examples and attributed maintained additions illustrate formatting. The generator is not a live Correos lookup.