Spanish Cadastral Reference Generator
Generate and format valid Spanish Cadastral References (Referencia Catastral) for development, PropTech, and QA testing.
About Spanish Cadastral Reference (Referencia Catastral)
The Referencia Catastral is an official, mandatory 20-character alphanumeric code assigned by the Spanish Directorate General for Cadastre (Dirección General del Catastro) to uniquely locate and identify real estate properties in Spain. It is required for real estate deeds, lease contracts, Property Registry certificates, and tax filings like IRPF and IBI.
This tool produces mathematically valid synthetic urban cadastral references. The code comprises 7 characters for the plot/land parcel, 7 for the cartographic sheet, 4 for the specific dwelling or unit, and 2 check letters derived using Modulo 23.
Cadastral Reference Anatomy & Specification
The Cadastral Reference consists of 20 alphanumeric characters structured into 4 logical blocks:
| Position | Field | Length | Meaning & Rule | Example |
|---|---|---|---|---|
| 1 to 7 | Plot / Parcel | 7 chars | Geographical identification of the land parcel or plot | 9872023 |
| 8 to 14 | Cartographic Sheet | 7 chars | Municipal cartographic sheet identification | VH5797S |
| 15 to 18 | Property / Unit | 4 chars | Specific unit or dwelling identifier (floor, door, or room) | 0001 |
| 19 and 20 | Check Characters | 2 letters | Two alphabetical verification characters computed via Modulo 23 | WX |
Control Character Calculation Algorithm (Double Modulo 23)
The official algorithm from the Directorate General for Cadastre utilizes two 11-character substrings combined with the unit code:
- 1. Build Substring 1 for the first DC: 7 parcel characters concatenated with the 4 unit characters (11 characters).
- 2. Build Substring 2 for the second DC: 7 cartographic sheet characters concatenated with the 4 unit characters (11 characters).
- 3. Map each character to a numeric value: digits 0-9 evaluate to 0-9; letters follow the 27-letter Spanish alphabet (A=1 to N=14, Ñ=15, O=16 to Z=27).
- 4. Multiply each character by its positional weight in [13, 15, 12, 5, 4, 17, 9, 21, 3, 7, 1] and sum the products.
- 5. The remainder of the division by 23 indexes the control character table 'MQWERTYUIOPASDFGHJKLBZX'.