This document is in English.For Simplified Chinese? Please click here.
This project is designed to guess and complete Chinese mainland ID numbers. It is useful when you don't remember part of your ID number or if a part of the document number is missing. The tool is available in both Python and Web versions. You can choose to run it locally with Python or deploy it on a server and implement it through front-end JS code. Note: This project is intended only for academic research purposes. Please comply with local laws and do not use it for illegal purposes. The author is not responsible for any misuse or consequences thereof.
NOTE: The C/C++ version is temporarily unavailable. If you are good at C/C++, you can submit a PR to help us improve it together.
- Download guessID.py and citycodes.txt and place them in the same folder. You can also download the entire repository:
git clone https://github.com/Gloridust/cnIDNumberGuesser
cd cnIDNumberGuesser
- Install dependencies
pip install psutil
Ensure you are using the pip version compatible with your Python. If working in multiple Python environments, you might need to use pip3
or a specific command like python -m pip install
.
- Run the program:
python3 guessID.py
- Usage: Input an 18-digit ID number, replacing missing parts with asterisks "*".
- After the program ends, check the results in resultID.txt. Please delete the original resultID.txt file before using it again.
- For web deployment, you can Fork this project, then select a branch and bind a domain on Github Page for immediate use.
- To deploy on your own server, download index.html, script.js, style.css, and citycodes.txt and place them in the same folder. You can also download the entire repository:
git clone https://github.com/Gloridust/cnIDNumberGuesser
cd cnIDNumberGuesser
- After deployment, visit index.html to start using. Similarly, input an 18-digit ID number, replacing missing parts with asterisks "*".
- Click “GuessID” to run. Once the result is obtained, it will be displayed below. You can also click “Download” to save the result in 'guessedIDs.txt' and download it to your device.
We fully respect user privacy. Whether it's the Python or Web version, all data is processed locally on the user's end and no data is uploaded.
Similarly, we hope users respect others' privacy and do not use this for illegal purposes; please comply with local laws and do not use it for illegal purposes. The author is not responsible for any misuse or consequences thereof.
The Python version of this project and the citycodes.txt file were inspired by content from https://github.com/wlkjyh/completion_idcard. Many thanks to the author for their open source contribution!
MIT