Egypt National ID Validator

Validate a 14-digit Egyptian National ID and decode its birth date, governorate and gender.

Ad placeholder (leaderboard)
Enjoying the tools? Go Pro for £4.99 (one-time) and remove all ads — forever, on this device. Remove ads — £4.99

Egypt’s National ID (الرقم القومي) is the primary civil identifier issued to every Egyptian citizen by the Civil Status Department. Far from being a random sequence, every digit block carries a defined meaning — and the 14th digit is a mathematical check that can catch transcription errors on the spot. This validator verifies all six structural rules in your browser, shows you exactly which check passed or failed, and decodes the birth date, governorate and gender embedded in the number.

How it works

The 14-digit ID follows the layout [C][YY][MM][DD][GG][SSS][G][V]:

PositionFieldContent
1Century marker2 = born 1900-1999 · 3 = born 2000-2099
2-3YearTwo-digit birth year (00-99)
4-5MonthBirth month (01-12)
6-7DayBirth day (01-31, calendar-validated)
8-9GovernorateIssuing governorate code (27 recognised values)
10-12SerialBirth-order sequence within that day and governorate
13GenderOdd = Male (ذكر) · Even = Female (أنثى)
14Check digitLuhn-variant checksum over digits 1-13

The validator runs six checks in sequence: digits-only input, exact 14-digit length, valid century marker, a real calendar date, a recognised governorate code, and a passing check digit. Any failing step is highlighted in red with a plain-English explanation.

The check-digit algorithm

The check digit at position 14 is computed using a Luhn-variant weighted-sum:

  1. Take each of the first 13 digits and multiply by alternating weights 2, 1, 2, 1, … (position 1 gets weight 2).
  2. If any product is 10 or greater, subtract 9 (equivalent to summing the two digits of the product — this is the standard Luhn reduction).
  3. Sum all 13 adjusted values.
  4. The check digit equals (10 − (sum mod 10)) mod 10.

This algorithm is implemented in the widely-used python-stdnum library (file stdnum/eg/nationalid.py by Arthur de Jong) and is confirmed by multiple cross-referenced test vectors. A mismatch between the supplied digit and the computed value almost always indicates a one-digit transcription error or a fabricated number.

Worked example

Consider the obviously fictional ID 2 90 01 01 01 123 1 1:

  • Century marker 2 → born 1900–1999
  • Year 90 + base 1900 → birth year 1990
  • Month 01January
  • Day 011st (calendar validates: 1 January 1990 is a real date)
  • Governorate 01Cairo (القاهرة)
  • Serial 1231 → last digit 1 is odd → Male (ذكر)
  • Check digit computation: weights [2,1,2,1,…] on 2900101011231 give products 4, 9, 0, 0, 2, 0, 2, 0, 2, 1, 4, 3, 2 → sum 29 → check = (10 − 9) mod 10 = 1
FieldRaw digitsDecoded
Century2Born 1900-1999
Birth date9001011 January 1990
Governorate01Cairo
Serial12311st male, serial 123
Check digit1Computed: 1 ✓

Full 14-digit ID: 29001010112311 — all six checks pass.

Formula note

The check digit formula is:

V = (10 − (Σ wᵢ × dᵢ mod 10)) mod 10*

where dᵢ are digits 1-13, wᵢ alternates 2, 1, 2, 1, … starting at position 1, and dᵢ* is the Luhn-reduced product (subtract 9 when ≥ 10). The algorithm is independent of the calendar and governorate fields — it operates purely on the 13-digit prefix as a flat numeric sequence. A correct check digit does not mean the embedded date and governorate are also valid; the validator checks all six rules independently so you can see exactly which part of the ID is malformed.

Frequently asked questions

Ad placeholder (rectangle)