South African ID Number Generator
Generate and format valid 13-digit South African ID Numbers (Luhn verified) for QA testing.
Waiting for generation...
About the South African ID Number
The South African ID is the 13-digit national identity number issued by the Department of Home Affairs (DHA).
Structured as YYMMDDSSSSCAZ: birth date (6 digits), gender code (4 digits), citizenship status (0=citizen, 1=resident), and a Luhn checksum digit.
Anatomy & Structure of South African ID Number — South Africa
The South African Identity Number consists of 13 numeric digits in 5 parts:
| Position | Field | Length | Meaning & Rule | Example |
|---|---|---|---|---|
| 1 to 6 | Date of Birth (YYMMDD) | 6 digits | Year (2 digits), Month (01–12), and Day (01–31) | 900115 |
| 7 to 10 | Gender & Daily Sequence | 4 digits | 0000–4999 = Female; 5000–9999 = Male | 5023 |
| 11 | Citizenship Status | 1 digit | 0 = SA Citizen; 1 = Permanent Resident | 0 |
| 12 | Historical / System Digit | 1 digit | Officially 8 (post-1994) | 8 |
| 13 | Check Digit | 1 digit | Calculated via **Luhn (Modulo 10)** algorithm | 4 |
Official Algorithm (Luhn Modulo 10 — DHA South Africa)
Official check digit calculation for South African ID:
A = Σ d[odd]; B = concat(d[even]) * 2; D = sum_digits(B); DV = (10 - ((A + D) mod 10)) mod 10
- 1. Sum odd position digits (1, 3, 5, 7, 9, 11) into total A.
- 2. Concatenate even position digits (2, 4, 6, 8, 10, 12) and multiply by 2 to get B.
- 3. Sum all individual digits of B into D.
- 4. Calculate total E = A + D.
- 5. The check digit is DV = (10 - (E mod 10)) mod 10.