El Salvador DUI Validator (RNPN)
Validate 9-digit Documento Único de Identidad (DUI) numbers for El Salvador via Modulo 10 check digit.
How does El Salvador DUI validation work?
Validation applies the official Modulo 10 weighted sum algorithm using descending weights 9 down to 2 on the first 8 digits.
Supports both hyphenated format (XXXXXXXX-Y) and raw 9-digit numbers.
DUI Structure
Composed of 9 digits:
| Position | Field | Length | Meaning | Example |
|---|---|---|---|---|
| 1-8 | Correlative | 8 digits | Serial sequence | 01234567 |
| 9 | Check Digit | 1 digit | Modulo 10 check digit | 8 |
Modulo 10 Validation Algorithm
RNPN Rules:
DV = (10 - (Sum % 10)) % 10
- 1. Weight the first 8 digits with [9, 8, 7, 6, 5, 4, 3, 2].
- 2. Calculate Modulo 10.
- 3. Compare with 9th digit.