DevTools Logo

South Africa ID Number Generator

South Africa ID Number Generator

Generate 13-digit South African ID numbers with birth date, gender, citizenship and Luhn check — synthetic test data only

Runs in your browser

For Development & Testing Purposes Only - Synthetic Mock Data

Settings

1 value

Generates one value with a valid checksum. Press ⌘/Ctrl+Enter for a fresh one.

Generated value

No value yet

Set options, then press Generate.

Generated values are valid in shape but randomized (Test Data).

Legal Disclaimer: Generated data is for software testing and validation purposes only (e.g. verifying input masks, form validation, or database seeding). It is randomly generated and not taken from any real record, but a random value can coincidentally match a real, issued number, so never use it in real applications, payments, KYC or official forms. Using it to impersonate real people or for any fraudulent activity is illegal. DevTools accepts no liability for how generated data is used.

    Examples

    Valid ID number

    Input
    8001015009087
    Output
    Valid — born 1 Jan 1980, serial 5009 (male), citizen, Luhn check 7

    The serial starts at 5009, the citizenship digit is 0 and the final Luhn digit matches.

    Wrong check digit

    Input
    8001015009088
    Output
    Invalid — check digit is 8 but the first 12 digits require 7 (Luhn)

    Only the last digit differs, so the date and citizenship checks still pass.

    Impossible month

    Input
    8013015009087
    Output
    Invalid — the first six digits (801301) are not a valid YYMMDD birth date

    Month 13 is rejected before the checksum is computed.

    About this tool

    The South Africa ID Number Generator produces one 13-digit identity number in the YYMMDD SSSS C A Z layout. Six digits carry the birth date, the four-digit serial marks gender (0000–4999 female, 5000–9999 male), the next digit is citizenship (0 citizen, 1 permanent resident, 2 refugee), and the following digit was historically used for race and is now usually 8.

    The final digit is a Luhn check digit over the preceding 12. The validator checks that the birth date is real, that the citizenship digit is 0, 1 or 2, and that the Luhn check passes, and it names the part that failed. That makes it a good complement to the VAT tool: one exercises a date and flag check, the other a pure checksum.

    These values are synthetic test data for QA and development: never use them on real applications, KYC checks, tax filings, or identity documents, and DevTools accepts no liability for how generated data is used. Everything runs locally in your browser.

    What this tool does not do

    • The validator does not enforce the 0000–4999 female and 5000–9999 male serial ranges.
    • The 12th digit is accepted as any value; it was historically used for race and is not validated.
    • The number does not state its century, so 800101 could decode to 1980 or 2080 and only 1900/2000 are tested.
    • A passing value proves the structure only, not that Home Affairs ever issued the number.

    How to use this tool

    1. Choose the SA ID option

      The tool is pinned to the 13-digit South African ID number with the Luhn check digit.

    2. Generate a value

      Click Generate to create one number with a real birth date, a gender serial, a citizenship digit and the usual 8.

    3. Validate or copy

      Switch to Validate to check the date, citizenship digit and checksum, or copy the result and download it as .txt.

    Use cases

    Onboarding fixtures

    Fill South African identity fields with numbers whose birth date and citizenship digit decode correctly.

    Gender serial tests

    Check that your parser treats serials below and above 5000 as different genders.

    Checksum comparison

    Verify your Luhn implementation against 8001015009087 and a one-digit variant.

    South African ID layout

    PartMeaning
    Digits 1-6Birth date, YYMMDD
    Digits 7-10Serial: 0000–4999 female, 5000–9999 male
    Digit 11Citizenship: 0 citizen, 1 permanent resident, 2 refugee
    Digit 12Historically race, now usually 8
    Digit 13Luhn check digit

    The validator checks the date, the citizenship digit and the checksum, not the gender serial range.

    Common mistakes

    Mistake:Assuming the 12th digit still encodes race

    Fix:It historically did; modern numbers usually carry 8 and the validator does not check it.

    Mistake:Reading a two-digit year as a fixed century

    Fix:The validator accepts 1900 or 2000 for the same YYMMDD, so test both interpretations.

    Mistake:Expecting the serial range to be enforced

    Fix:The validator allows any 4-digit serial, so an out-of-range gender code will not be flagged.

    Frequently asked questions

    Are these real South African ID numbers?

    No. They are synthetic values for QA and development, never for real applications, KYC checks, tax filings, or identity documents. A valid-looking value can coincide with an issued number; DevTools accepts no liability for how generated data is used.

    How does the ID number encode gender?

    The four-digit serial marks gender: 0000 to 4999 is female and 5000 to 9999 is male. The validator checks the date, citizenship and checksum, not the serial range.

    What does the citizenship digit mean?

    0 marks a citizen, 1 a permanent resident and 2 a refugee, and the validator rejects any other value in that position.

    What is the 12th digit for?

    It was historically used for race and is now usually 8. The validator accepts any value there and does not check it.

    How is the check digit calculated?

    The 13th digit is a Luhn check digit over the first 12 digits, and it can be recomputed to confirm whether a pasted number is correctly formed.