Skip to main content

Spanish Cadastral Reference Generator

Generate and format valid Spanish Cadastral References (Referencia Catastral) for development, PropTech, and QA testing.

Waiting for generation...

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:

PositionFieldLengthMeaning & RuleExample
1 to 7Plot / Parcel7 charsGeographical identification of the land parcel or plot9872023
8 to 14Cartographic Sheet7 charsMunicipal cartographic sheet identificationVH5797S
15 to 18Property / Unit4 charsSpecific unit or dwelling identifier (floor, door, or room)0001
19 and 20Check Characters2 lettersTwo alphabetical verification characters computed via Modulo 23WX

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:

DC = 'MQWERTYUIOPASDFGHJKLBZX'[sum(charVal * weight) % 23]
  1. 1. Build Substring 1 for the first DC: 7 parcel characters concatenated with the 4 unit characters (11 characters).
  2. 2. Build Substring 2 for the second DC: 7 cartographic sheet characters concatenated with the 4 unit characters (11 characters).
  3. 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. 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. 5. The remainder of the division by 23 indexes the control character table 'MQWERTYUIOPASDFGHJKLBZX'.

Frequently Asked Questions & Technical Guidelines