| Code | Scope | Length | Check digit | Confidence |
|---|---|---|---|---|
CR_CEDULA_FISICA |
both (personal + tax for naturales) | 9 | none (format only) | high |
CR_DIMEX |
personal | 11 or 12 | none | moderate |
CR_CEDULA_JURIDICA |
tax | 10 | none (format only) | high |
CR_CEDULA_FISICA — Cédula de IdentidadPersonal identity document issued by the Tribunal Supremo de Elecciones (TSE) — Registro Civil. Doubles as the personal tax ID at Hacienda's DGT, where it is internally padded to 10 digits with a leading 0 for filings.
0-0000-0000No check digit. The TSE does not publish a verifier algorithm and the 9-digit cédula carries no embedded checksum. Validation is structural (regex ^[1-9]\d{8}$).
provincia in 1..9
tomo = 4 digits
asiento = 4 digits
countries-comprehensive-tier1.md § Costa Rica) — accessed 2026-05-08valid:
- 1-1234-5678
- 5-9876-5432
- 7-0000-0001
- 8-1111-2222
- 9-9999-9999
invalid (format):
- "" (empty)
- 0-1234-5678 (provincia 0)
- 1234 (too short)
- 1234567890 (too long)
- ABCDEFGHI
invalid (checksum):
- n/a (no check digit)
None known in the last 24 months affecting format.
formatForHacienda() helper? Tracking as ADR candidate.CR_DIMEX — Documento de Identidad Migratorio para ExtranjerosIdentity document for foreign residents, issued by the Dirección General de Migración y Extranjería.
1 for residentes, remaining digits encode tipo de residencia + correlativo (Migración has not published a stable composition formula)No check digit publicly documented. Validation is length (11 or 12 digits) + numeric only.
valid:
- 12233445566 (11 digits)
- 10000000001
- 19999999999
- 155667788990 (12 digits)
- 100000000001
invalid (format):
- "" (empty)
- 1234567890 (10 digits)
- 1234567890123 (13 digits)
- ABCDEFGHIJK
None known in the last 24 months affecting format.
moderate until a public-source composition or verifier is confirmed.CR_CEDULA_JURIDICA — Cédula JurídicaTax identifier for legal entities, issued by the Registro Nacional (Registro de Personas Jurídicas) and used by Hacienda.
3 (jurídicas) + 3 tipo entidad + 6 correlativo3-000-000000No check digit. Validation is structural (regex ^3\d{9}$).
prefix = '3'
tipo = 3 digits (101 = SA, 102 = SRL, ...)
correlativo = 6 digits
countries-comprehensive-tier1.md § Costa Rica) — accessed 2026-05-08valid:
- 3-101-123456
- 3-102-987654
- 3-110-000001
- 3-002-000000
- 3-999-999999
invalid (format):
- "" (empty)
- 2-101-123456 (prefix 2)
- 5-101-123456 (prefix 5 — that's `CR_NITE`, separate type)
- 0-101-123456 (prefix 0)
- 31011234567 (too long)
None known affecting format.
CR_NITE (entidades sin cédula jurídica, prefix 5) is a separate document type used by Hacienda for sucesiones, condominios, fideicomisos, etc. It is not included in this initial release; track as future addition.CR_PASAPORTE — PasaporteTravel document issued by the Dirección General de Migración y Extranjería (DGME CR). Biometric ePassport (G+D, since 2021). Numbers are 9 chars alphanumeric, often letter-prefixed.
None on the printed number. MRZ check digit lives in
algorithms/icao-9303.ts.
low — no first-party publication of the format spec.