User Rating 0.0
Total Usage 0 times
Category Generators
Is this tool helpful?

Your feedback helps us improve.

About

Spanish addresses follow a rigid hierarchical format defined by the INE (Instituto Nacional de Estadística) and Correos postal system. A valid address requires a street type (tipo de vía), a street name, a building number, an optional floor/door designation in the format 3º 2ª, a 5-digit postal code (código postal) where the first two digits encode the province (01-52), and the municipality plus province name. Getting the postal code prefix wrong means mail goes to an entirely different region. This tool generates addresses that conform to the real postal code allocation table published by Correos, uses authentic Spanish street naming conventions, and calculates DNI check letters using the official modulo-23 algorithm. Results are suitable for form testing, database seeding, and UI mockups. They are fictitious combinations and should not be used for fraudulent purposes.

spain address generator random spanish address fake spain address spanish postal code generator DNI generator spain data generator

Formulas

Spanish postal codes are 5-digit numbers. The first two digits represent the province code assigned by Correos:

CP = provincePrefix × 1000 + rand(0, 999)

where provincePrefix {01, 02, …, 52} and the suffix is zero-padded to 3 digits.

The DNI check letter is computed using the official algorithm mandated by the Spanish Ministry of Interior:

letter = T[dniNumber mod 23]

where T = "TRWAGMYFPDXBNJZSQVHLCKE". For NIE documents, the leading letter is replaced: X 0, Y 1, Z 2, then the same modulo-23 lookup applies.

Spanish mobile phone numbers follow the pattern 6XX or 7XX followed by 6 random digits, totaling 9 digits. Landlines start with 9 followed by the provincial area prefix.

Reference Data

ProvinceCapitalCP PrefixAutonomous CommunityPopulation (approx.)
ÁlavaVitoria-Gasteiz01País Vasco333,940
AlbaceteAlbacete02Castilla-La Mancha388,270
AlicanteAlicante03Comunidad Valenciana1,879,888
AlmeríaAlmería04Andalucía727,945
AsturiasOviedo33Asturias1,011,792
ÁvilaÁvila05Castilla y León157,664
BadajozBadajoz06Extremadura672,137
BarcelonaBarcelona08Cataluña5,743,402
BurgosBurgos09Castilla y León357,070
CáceresCáceres10Extremadura391,850
CádizCádiz11Andalucía1,244,049
CantabriaSantander39Cantabria584,507
CastellónCastellón de la Plana12Comunidad Valenciana579,962
Ciudad RealCiudad Real13Castilla-La Mancha495,045
CórdobaCórdoba14Andalucía781,451
A CoruñaA Coruña15Galicia1,121,815
CuencaCuenca16Castilla-La Mancha196,139
GironaGirona17Cataluña781,788
GranadaGranada18Andalucía919,168
GuadalajaraGuadalajara19Castilla-La Mancha261,995
GuipúzcoaSan Sebastián20País Vasco727,121
HuelvaHuelva21Andalucía524,278
HuescaHuesca22Aragón228,409
JaénJaén23Andalucía631,381
LeónLeón24Castilla y León456,439
LéridaLérida25Cataluña440,915
La RiojaLogroño26La Rioja319,914
LugoLugo27Galicia327,946
MadridMadrid28Madrid6,779,888
MálagaMálaga29Andalucía1,685,920
MurciaMurcia30Murcia1,518,486
NavarraPamplona31Navarra661,197
OurenseOurense32Galicia306,650
PalenciaPalencia34Castilla y León160,321
Las PalmasLas Palmas de Gran Canaria35Canarias1,131,065
PontevedraPontevedra36Galicia942,731
SalamancaSalamanca37Castilla y León327,453
S. C. de TenerifeSanta Cruz de Tenerife38Canarias1,044,887
SegoviaSegovia40Castilla y León153,342
SevillaSevilla41Andalucía1,950,219
SoriaSoria42Castilla y León88,600
TarragonaTarragona43Cataluña816,772
TeruelTeruel44Aragón134,176
ToledoToledo45Castilla-La Mancha703,772
ValenciaValencia46Comunidad Valenciana2,591,875
ValladolidValladolid47Castilla y León520,649
VizcayaBilbao48País Vasco1,152,651
ZamoraZamora49Castilla y León170,588
ZaragozaZaragoza50Aragón972,528
CeutaCeuta51Ceuta84,202
MelillaMelilla52Melilla87,076

Frequently Asked Questions

Yes. Each postal code uses the official 2-digit province prefix assigned by Correos (the Spanish postal service). The prefix 28 always maps to Madrid, 08 to Barcelona, 41 to Sevilla, and so on. The remaining 3 digits are randomly generated within the valid range 000-999, which means the code structurally conforms to the Correos system. However, not every combination within a province prefix corresponds to an active delivery route.
The generator uses the official Spanish algorithm: divide the 8-digit DNI number by 23 and use the remainder as an index into the string "TRWAGMYFPDXBNJZSQVHLCKE". This produces the exact same letter that the Spanish National Police would assign. The calculation is deterministic - every DNI number maps to exactly one valid letter.
These addresses are designed for exactly that purpose: form validation testing, UI/UX mockups, database population, and development environments. The data combines real province names, real city names, and plausible street names with randomized numbers, so they look authentic in form fields. They should never be used for identity fraud, impersonation, or any deceptive purpose.
Spanish apartment addresses commonly include the floor number (planta) followed by the ordinal suffix º and the door letter or number with the suffix ª. For example, "3º 2ª" means third floor, second door. This is standard in multi-story residential buildings throughout Spain. The generator includes these designations with approximately 60% probability to reflect realistic urban address distribution.
Yes. Spanish mobile numbers are 9 digits starting with 6 or 7. Landline numbers start with 9 followed by a provincial area code. The generator produces numbers that pass format validation checks but are randomly composed, so they are unlikely to correspond to active lines. The international prefix +34 is prepended when the full format option is selected.