ID number check / parse
Paste a list of numbers and get checksum validity, birth date, gender, full age and province at once; invalid ones come with the exact reason.
身份证号码是怎么构成的,校验位又是怎么算的?
18 位号码的六段含义:前 6 位是地址码(GB/T 2260 行政区划代码,第 1~2 位是省级、第 3~4 位是市级、第 5~6 位是区县级),第 7~14 位是出生日期(YYYYMMDD,例如 19900307 表示 1990 年 3 月 7 日),第 15~17 位是顺序码(同一地址码、同一天出生的人按登记顺序编号),第 17 位同时用来区分性别(奇数男性、偶数女性),第 18 位是校验位(0~9 或 X)。所以一个号码里能直接读出来的信息只有:省级行政区、出生日期、性别,以及校验位对不对——姓名、民族、住址、签发机关都不在号码里。
校验位是怎么算的(ISO 7064 MOD 11-2):把前 17 位数字从右往左分别乘以固定权重 2、4、8、5、10、9、7、3、6、1、2、4、8、5、10、9、7(从左往右写就是 7、9、10、5、8、4、2、1、6、3、7、9、10、5、8、4、2),把 17 个乘积相加后对 11 取余,余数 0~10 依次对应校验位 1、0、X、9、8、7、6、5、4、3、2。因为余数有 11 种而阿拉伯数字只有 10 个,其中一种必须用字母表示,这就是末位会出现 X 的原因(X 代表罗马数字 10)。本工具完全按这套算法计算,并把「期望校验位」直接写给你,方便你核对自己是不是抄错了一位。
为什么校验通过不等于「真号」:校验位只是一道算术自检,它能拦住绝大多数抄写错误(输错一位、相邻两位写反、少写或多写一位),但挡不住刻意编造——任何人只要把前 17 位编好再按公式补上末位,就能得到一个校验位完全正确的号码。同理,本工具不查市县、不查是否真的登记过、也不做任何联网比对,因此「校验合法」只说明这串数字格式上像一个身份证号,绝不说明它对应一个真实存在的人。反过来说,如果你只是想验证一个号码的格式与信息段,本工具足够;如果你想确认某人身份真伪,正确做法是走对方授权的人脸核身 / 官方核验渠道,而不是拿号码去网上「查真伪」——那些网站多半是在收集你的号码。
15 位老号和 18 位有什么区别、怎么升位:1985 年第一代身份证发的是 15 位号,它没有世纪前缀(出生日期只有 6 位 YYMMDD,默认 19 开头)也没有校验位,结构是 6 位地址码 + 6 位出生日期 + 3 位顺序码(末位区分性别)。1999 年换发二代证起统一改为 18 位,升位规则只有两步:在出生日期前补上「19」凑成 8 位,再按上面的 MOD 11-2 公式算出校验位补在最后。所以 15 位与 18 位是同一个人的同一份登记信息,升位后的号码是确定且唯一的——本工具对 15 位号码会直接给出升位结果,方便你把老证件上的号码和新系统里的号码对上。
为什么不要在陌生网站上输入身份证号:身份证号 + 姓名是最常用的实名组合,一旦连同姓名、手机号一起被收集,就可能被用于冒名注册、办理业务甚至电信诈骗。市面上不少「身份证真伪查询」「号码归属地查询」页面,实际上既查不到真伪(没有任何公开接口能查),又把用户输入的号码存进了自己的数据库——你查询的同时就完成了一次信息上交。本工具的做法相反:整页没有任何网络请求,号码不进 URL、不进 localStorage / sessionStorage、不写 cookie、不打印到控制台,计算完就只存在于这个页面的内存里,关掉或刷新页面即彻底消失。你可以打开浏览器开发者工具的 Network 面板自行核验:全程不会出现带着号码的请求。
FAQ
No. The check digit is just an arithmetic self-test of the first 17 characters (ISO 7064 MOD 11-2): anyone can invent 17 digits and complete a correct final digit to get a number that 'passes'. This tool also does not look up specific cities or counties, so it cannot tell whether the number actually exists - it answers exactly two questions: is the format legal (length, characters, date, provincial region code, checksum), and what can be read out of it (birth date, gender, full age, province). To verify a real identity, use face verification with the person's authorization or official channels.
The 15-digit number belongs to the first-generation card, whose birth date had only 6 digits (YYMMDD); the 18-digit number has been standard since the second generation, with an 8-digit birth date (YYYYMMDD). Because first-generation cards were all issued before 2000, the year inside a 15-digit number defaults to 19xx, so upgrading is two steps: insert 19 before the 7th position, then recompute the checksum. For a 15-digit input this page directly outputs the upgraded 18-digit result.
It means the check digit computed from your first 17 characters differs from the final digit you entered - most often one digit was mistyped or two adjacent digits were swapped. The 'expected checksum' shown in the result is the correct final digit recomputed from your 17 characters: if it differs from the actual last digit by exactly one position, a copying slip is almost certain; if it points to an obviously different number, the number itself is most likely invented. Note that X is always treated as uppercase - a typed lowercase x is normalized automatically.
The tool's province table covers the 34 province-level divisions (including Hong Kong, Macao and Taiwan) plus special codes 71 (Taiwan), 81 (Hong Kong), 82 (Macao) and 91 (abroad); if the first two digits are not in the table, it reports unknown. Also, this tool parses only down to province level - it does not match cities or counties - so even when the province matches, that does not prove the first 6 digits correspond to a real district or county.
No. The number is computed only in your own browser: no upload, no storage, closing the page destroys it; the page makes no network request at all, and the number never enters the URL, localStorage / sessionStorage, cookies, or the console. For batch pasting, keep it under 200 numbers per run (a browser rendering limit) - the excess is reported and truncated automatically, and even a thousand-line paste will not freeze the page.