At the front desk of a hotel in Hangzhou, a clerk takes the card, slides it into a reader, and waits for the machine to beep.

The guest has handed over a small rectangle of plastic with a photograph on one side and a string of eighteen digits on the other. The clerk does not look at the photograph. She looks at the digits, and after a second she says, without thinking about it, that the guest was born in the spring.
Everything she needs is in the number. It is not a random string. It is a document written in digits, and almost everybody in China can read part of it at a glance.
An ID card in China is less a proof of age than a key to services, and the number on it is the part that machines actually read. The plastic is the carrier. The digits are the identity.
Eighteen Digits, Four Blocks
The number is defined by a national standard first issued in 1999, and it has not changed since. It is called the citizen identity number, and it is eighteen characters long.
The first six digits are an address code. They describe where the card was issued, down to the district or county level.
The next eight digits are a date. Year, month and day, written in that order, with no separators.
The next three are a sequence code. They separate people who were born on the same day in the same place.
The last character is a check digit. It is calculated from the first seventeen, and it exists to catch typing errors.
That is the whole structure. Four blocks, one line, no punctuation.
The card itself is small enough for a wallet and stiff enough to survive a washing machine, which is the minimum requirement for an object that a person is expected to carry every day.
The eighteen-digit format is younger than most people assume. The first national identity cards, issued from the mid-1980s, carried fifteen digits and were printed on paper laminated in plastic.
The current version arrived in 1999, when the extra digits were added to hold a full four-digit year and a check character. Anyone whose card was issued before that still has a number that systems have to translate.
The Address In The First Six
The address code follows the same system that governs official documents, postal addresses and statistics. A province has a two-digit code, a city adds two more, and a district or county adds two more.
Beijing begins with 11. Shanghai begins with 31. Guangdong begins with 44. Sichuan begins with 51.
People who have moved around the country learn the codes without meaning to. A recruiter glancing at a résumé can tell roughly where an applicant is from. A landlord can tell whether a tenant’s card was issued in the city where they are renting.
This is one of the quiet frictions of the system. The address on the card is the address at the time of issue, not the address where the person lives now. A student who left a small town at eighteen may carry that town’s code for the rest of their life.
The code is not a record of ethnicity, income or family. It is closer to a postmark.
Administrative maps change. A county becomes a district, two districts merge, a new development zone gets its own code. When that happens, existing cards are not reissued. The old code stays on the plastic until the card expires, and the registry keeps a table that maps retired codes to the places they used to mean.
There is a version of this in every country with a national identity document. A driver’s licence records a date of birth and an address, and a social security number carries a place of issue.
What is unusual in China is how routinely the number is read aloud, written on forms and photographed, because so much of daily life is tied to it.
The Birthday In The Middle
Digits seven to fourteen are the birth date, and they are the part that everybody notices.
An eighteen-digit number with 19900312 in the middle is not ambiguous. It says the holder was born on 12 March 1990, and it says so to a hotel clerk, a ticket inspector, a bank teller and anyone else who is handed the card.
The birth date matters because age is a threshold in Chinese life. It decides when a child starts school, when a person can vote, when they can marry, when they can retire, and how much they pay for a ticket.
The date is also the reason the number feels less private than it is. A birthday is something people share. It appears on birthday cakes, in group chats, on the profile pages of apps. So the middle of the number is often already known to anyone who has spent a week in the same office.
That is the first half of an important point about this card: most of it is not secret. The information is either public by convention or easy to infer.
The date has one more use that visitors rarely think about. Ticket machines, hospital kiosks and ticket counters all read it to calculate an age, and then apply a price. A child under a certain height or age travels free. A senior over sixty gets a discount. The number does the arithmetic so that a clerk does not have to.
The Number That Says Your Sex
The seventeenth digit carries a piece of information that surprises visitors. An odd number means male. An even number means female.
The seventeenth digit is part of the sequence code, which exists to tell apart people born on the same day in the same place. In practice, the sequence also encodes sex, because the registry needed a simple way to keep the count ordered.
This is why a form can ask for the last four digits and still learn something. The last four are the sequence and the check character, and one of them quietly states whether the holder is a man or a woman.
For most of daily life this is invisible. It becomes visible in the small moments when a number is read out in a waiting room, or when a screenshot of a form is posted online with only the name blacked out.
The Last Digit Is A Sum
The final character is the most technical and the least personal.
It is computed from the seventeen digits before it, using a standard method designed for identification numbers. Each digit is multiplied by a fixed weight, the results are added, and the total is divided by eleven. The remainder decides what the last character will be.
Because there are eleven possible remainders and ten digits, one result has no digit to represent it. That result is written as the letter X, which is the Roman numeral for ten.
This is why some Chinese ID numbers end in a letter, and why people who have one sometimes have to explain it at a ticket counter. It does not indicate anything special. Under the algorithm, roughly one number in eleven ends that way.
The check digit is not a security feature. It is a spell-checker. If somebody mistypes one digit of a long number, the last character will no longer match, and the system will reject the entry before it reaches a database.
The choice of eleven as a divisor is deliberate. A modulus of eleven catches every single mistaken digit, and it catches almost every case where two adjacent digits are swapped, which are the two most common human errors in a long number.
That distinction matters later, when the number is used as a password.
The letter at the end causes small confusions of its own. Some forms insist on an uppercase X, some accept a lowercase x, and a few older systems reject both. People who have one learn to say it out loud: the number, and then the letter.
Why Four Digits Caused A Scare
In late November 2026, a game spread through Chinese social media. People were posting the last four digits of their identity number and asking others to do the same, as a way of finding strangers with matching numbers.
The game looked harmless. Four digits are not a document. They cannot open a bank account, and they cannot be used to board a train.
Then the police began to warn people about it. A number of officers posted videos explaining that the last four digits are the part that cannot be guessed. The first fourteen are a postcode and a birthday, both of which are semi-public. The last four are the only part that is not sitting in a profile somewhere.
The warning was not that four digits are dangerous on their own. It was that they are the missing piece of a puzzle that fraudsters assemble from other fragments: a name from a delivery label, a phone number from a group chat, a hometown from a social media post, a birthday from a photograph of a cake.
With those pieces, a caller can sound convincing. They can recite the address and the birth date, and the person on the other end relaxes, because the caller seems to know them.
The same four digits are also used as a verification answer in ordinary customer service. A bank, a phone company or a delivery platform may ask for the name and the last four digits before discussing an account. That makes the digits a key, even if it is a key that only works on one lock.
Under Chinese privacy law, the identity number is classified as sensitive personal information, which means it requires a separate and explicit consent to collect, and stricter handling afterwards.
The scare had a second, quieter effect. It reminded people that the same four digits are routinely demanded by employers, delivery companies and ticket platforms, and that those copies of the number sit in databases that a customer never sees.
Lawyers quoted in the coverage made a distinction that is easy to lose in the noise. A hotel or a ticket office may legitimately ask for the number, because the transaction requires it. A shopping app that asks for it in order to send a discount code is a different matter.
None of this makes the number a secret in the way a password is. It makes it a piece of information that is worth not scattering.
A Card You Cannot Leave Home Without
The ID card is required for more of daily life than a foreign visitor expects.
A train ticket is bought against it. A hotel room is registered against it. A mobile phone number is activated with it. A hospital appointment, a university exam, a bank account, a property deed and a marriage registration all pass through it.
Children can hold one too, and many families apply when a child is small, because the card simplifies travel, medical visits and school paperwork. A child’s card is valid for five years, so that the photograph keeps up.
Validity depends on age. A card issued in the teenage years lasts ten years. One issued in the twenties or thirties lasts twenty. After forty-six, the card can be issued for long-term use, because the face stops changing enough to matter.
The physical card has been supplemented, not replaced. A digital version exists inside several government and payment apps, and a growing number of situations accept a code on a phone instead of a piece of plastic.
The dependence becomes obvious when the card is missing. A traveller who loses it at a station cannot simply buy a ticket, because the ticket is tied to a number that has to be verified. There is a temporary document for exactly this situation, printed at a window, valid for a day or two.
Foreign residents have their own version, a permanent residence card that also carries a number and a photograph. Visitors on short stays do not, which is why a passport takes over the same role at a hotel desk.
But the number is still the anchor. The card is the object that proves the number belongs to a face, and the number is what the systems actually store.
For a visitor, the practical lesson is simple. The number is treated as an identifier, not a secret, and yet it is protected by law and by etiquette. Chinese friends may share a birthday freely and still refuse to type the last four digits into a group chat.
The Card In A Wallet
Back at the hotel desk, the clerk finishes the registration and slides the card back across the counter, face down, with two fingers.
The guest puts it away, and the number goes back to being an object in a wallet, doing nothing.
It will be needed again at the station in the morning, and at the hospital in the afternoon, and at the phone shop on the weekend. Each time, a machine will read eighteen digits and decide whether to open a door.
And each time, somebody behind a counter will glance at the middle of the number and know, without asking, roughly how old the person standing in front of them is.
This story is based on publicly documented practices and on reporting in the Chinese and international press. The families described are illustrative, and no individual is identified.