Iran National Code Validator (Code Melli, کد ملی) เครื่องรับรองรหัสแห่งชาติอิหร่าน

ติดรหัสประเทศหนึ่งหรือหลายๆ รหัส 10 หลัก เพื่อตรวจสอบตัวเลขสุดท้ายและดูว่าอันไหนที่ใช้ได้

ทำงานในเบราว์เซอร์ของคุณ ไฟล์ไม่ออกจากอุปกรณ์ ดูวิธีตรวจสอบ

…

วิธีทำ

  1. 1
    เล็บรหัส

    เขียนรหัสประเทศหนึ่งในแต่ละแถว

  2. 2
    เช็คดู

    ทุกเส้นถูกทําความสะอาด, ปอดและตรวจสอบ

  3. 3
    อ่านเหตุผล

    ดูว่าทําไมสายไฟที่ล้มเหลวถึงล้มเหลือง

  4. 4
    สร้างรหัสทดสอบ

    สร้างรหัสสุ่มที่ใช้ในการทดสอบแบบฟอร์ม

  5. 5
    ส่งรายการออก

    สําเนารหัสผ่าน หรือดาวน์โหลดผล

เกี่ยวกับเครื่องมือนี้

Every Iranian citizen has a 10-digit national code, code melli, printed on the national ID card and the birth certificate. Banks, the tax administration, universities, insurers and online shops ask for it, and it is the key to almost every e-government service. The first three digits are the code of the registration office that issued it, the next six are a serial number and the tenth digit is a check digit that catches most typing mistakes. This validator applies the check digit rule to one code or a whole list, reads Persian and Arabic digits, puts back leading zeros that spreadsheets often drop, and rejects codes made of one repeated digit such as 1111111111, which pass the formula but are not issued.

Who this is for

Developers and data teams building forms and imports for Iranian users, HR and payroll staff cleaning employee lists, and anyone who wants to check a code before submitting a form.

The check digit rule

1. Take the first nine digits. 2. Multiply them by 10, 9, 8, 7, 6, 5, 4, 3 and 2 in turn, and add the results. 3. Find the remainder of the sum divided by 11. 4. If the remainder is less than 2, the check digit equals the remainder. Otherwise it is 11 minus the remainder. 5. The tenth digit of the code must equal this check digit.

Leading zeros

Many codes start with 0 or 00, for example codes issued in Tehran. Spreadsheets store them as numbers and drop the zeros, so 0084575948 becomes 84575948. The validator pads an 8 or 9-digit number back to 10 digits before checking.

Persian digits

Codes copied from Persian documents use Persian digits (۰۱۲۳۴۵۶۷۸۹) or Arabic-Indic digits (٠١٢٣٤٥٦٧٨٩). They are converted to Latin digits first, so ۰۰۸۴۵۷۵۹۴۸ is read as 0084575948.

Batch checking

Paste one code per line, up to thousands, and the results show which lines pass and why the others fail: wrong length, a repeated digit, or a wrong check digit. Copy the valid ones or export the list.

Worked example

For 0084575948 the weighted sum of the first nine digits is 0×10 + 0×9 + 8×8 + 4×7 + 5×6 + 7×5 + 5×4 + 9×3 + 4×2 = 212. 212 mod 11 is 3, and 11 − 3 = 8, which matches the last digit, so the code passes. Changing the last digit to 9 makes it fail.

Test codes

The "make" button creates random codes that pass the check, for testing forms. They are not real people's codes.

Limits

A format check only. A code that passes is not proof that it belongs to a real person; only the civil registration office can confirm that.

ตัวอย่างพร้อมวิธีทำ

0084575948 passes: the weighted sum 212 leaves remainder 3, and 11 − 3 = 8.

สรุปสั้น ๆ

คำถามที่พบบ่อย

มีรหัสเมลลีกี่หลัก

10 รหัสที่เริ่มด้วยศูนย์ ยังมี 10 หลัก

ตัวเลขสุดท้ายคิดเป็นอย่างไร

คูณ 9 ตัวเลขแรกด้วย 10 ลงมาเป็น 2 เอายอด mod 11; ถ้ามันต่ํากว่า 2 นั่นก็คือตัวเลข, ไม่งั้น 11 ลบมัน

ทําไม 1111111111 จะล้มเหลว?

รหัสที่มีหลักซ้ําหนึ่งผ่านสูตร แต่ไม่เคยออก ดังนั้นจึงถูกปฏิเสธ

ฉันใส่ตัวเลขเปอร์เซียได้มั้ย

ใช่ เลขเปอร์เซียและอารบิกถูกแปลงโดยอัตโนมัติ

รหัสที่ใช้ได้ จะพิสูจน์ตัวตนหรือเปล่า

ไม่ มันแค่แสดงว่าตัวเลขนั้นมีรูปทรงดี

รหัสโหลดแล้วเหรอ

ไม่ครับ เช็คจะทํางานในบราว์เซอร์ของคุณ

ฟรีทั้งหมดไม่มีค่าใช้จ่าย ไม่ต้องสมัคร
ไฟล์เป็นส่วนตัวทุกอย่างทำงานในเบราว์เซอร์ของคุณ
ใช้ง่ายในภาษาของคุณมีหลายภาษา