Costa Rica Identity Card Validator (TSE)
Validate the structural integrity of 9-digit Costa Rica Cédula de Identidad numbers.
How does Costa Rica Cédula validation work?
It verifies that the document contains exactly 9 decimal digits, a valid province code (1-9), and non-zero volume and entry numbers.
Accepts both formatted (P-TTTT-AAAA) and raw numeric input.
Cédula Structure
Components of the 9-digit code:
| Position | Field | Length | Meaning | Example |
|---|---|---|---|---|
| 1 | Province | 1 digit | Province code (1 to 9) | 1 |
| 2-5 | Volume | 4 digits | Registry volume | 0234 |
| 6-9 | Entry | 4 digits | Registry entry | 0567 |
Structural Validation Algorithm
TSE Verification:
Strict 9-Digit Number Validation
- 1. Strip non-digits and assert exactly 9 digits length.
- 2. Check province within [1..9].
- 3. Reject volume or entry with '0000'.