CURP Validator

DGIS-SEUL aligned · Validates root segment (1–16) and position 17 format · Position 18 not validated

Validate a captured CURP against demographic data

Compute the 16-character root from demographic data

Useful as a capture aid: shows how positions 1–16 should look for a given person.

Batch validation

Paste CSV or JSON, or upload a file. CSV header must be: paternalSurname,maternalSurname,givenNames,dateOfBirth,sex,entityCode,capturedCurp

Validation rules and scope

This service applies the rules described in the DGRNPI document "Reglas para la Ejecución de los Procedimientos para la Asignación de la CURP". Per DGIS guidance for SEUL certification, validation covers:

Foreign-born and special populations

The 18-character CURP format and the construction algorithm are identical for everyone — what changes is the supporting documentation, the entity code (positions 12–13), and which institution issues the CURP. The validator handles every case below the same way:

Note for HarmoniMD: when the patient hands you an official CURP that was already issued by INM/DGRNPI, capture it verbatim. The validator will rebuild the root from the demographic data and flag any mismatch. For people whose source country uses only one surname, leave the maternal-surname field blank — rule 5.1.10 is automatically applied.

Endpoints

GET  /api/health
GET  /api/entities
GET  /api/demo-cases
POST /api/build              { paternalSurname, maternalSurname, givenNames, dateOfBirth, sex, entityCode }
POST /api/validate           { ...above, capturedCurp }
POST /api/validate-batch     [ {record}, {record}, ... ]

Rules implemented (positions 1–4)

  1. 5.1.1 — leading ÑX
  2. 5.1.2 — compound given names: use first word
  3. 5.1.3 — exception to 5.1.2: if first given is MARIA / MA. / MA / M. / M / JOSE / J. / J → use the next non-particle given name
  4. 5.1.4 — special chars (/ - . ') intervening: X
  5. 5.1.5 — compound surname: first word
  6. 5.1.6 — ÜU
  7. 5.1.7 — skip leading particles (DA, DAS, DE, DEL, DER, DI, DIE, DD, EL, LA, LAS, LE, LES, LOS, MAC, MC, VAN, VON, Y)
  8. 5.1.8 — first 4 letters in profanity catalog: replace 2nd letter with X
  9. 5.1.9 — no internal vowel: X at position 2
  10. 5.1.10 — single surname: X at position 3
  11. 5.1.11 — no surnames: XXX + name initial

Rules implemented (positions 14–16)

  1. 5.2.1 — internal ÑX
  2. 5.2.2 — no internal consonant → X
  3. 5.2.3 — single surname → X at position 15
  4. 5.2.4 — compound given name: first internal consonant of first word
  5. 5.2.5 — exception to 5.2.4 for MARIA / MA. / JOSE / J. variants
  6. 5.2.6 — no surnames: XX + consonant of name
  7. 5.2.7 — special chars in consonant scan → X