Having recently arrived in Spain, I finally got my health card! But when I received it, I was a bit baffled by the long string of digits on it. What exactly is this number’s format? Are there any other curious newcomers like me? I did some research and wanted to share what I found. I also welcome experienced folks to add or correct anything!
Actually, the Spanish health card number doesn’t have a single, nationwide standard format; each autonomous community manages its own system. However, they generally follow a similar structure, which is mainly used to identify the cardholder’s autonomous community and personal information. The card I have is from the Community of Madrid, so I’ll use it as an example.

Breakdown of the Health Card Number
This number is often called the CIPA (Código de Identificación Personal Autonómico), which translates to Autonomous Community Personal Identification Code. While the details vary by region, it generally includes the following components:
1. Autonomous Community Code
The first few digits of the number typically identify the issuing autonomous community. For example, the code for the Community of Madrid is usually 08. Each community has its own unique code, allowing the system to quickly recognize which healthcare system you belong to. I’ve put together a simple table listing the codes for some common communities, but it may not be completely accurate as codes can change with system updates.
| Autonomous Community | Possible Code |
| Andalucía | 01 |
| Cataluña | 09 |
| Madrid | 08 |
| Valencia | 10 |
| Galicia | 12 |
2. Internal Identifier and Check Digits
The next part is a long string of numbers. This is an internal code used by the system to uniquely identify you, possibly generated based on your personal information through a specific algorithm. The last one or two digits are usually check digits, used to verify the entire number’s accuracy and prevent data entry errors. Therefore, never try to guess or make up this number, as it will definitely be invalid.
As regular users, we don’t really need to delve into the specific algorithm behind each digit. The most important thing is to keep your health card safe, as you’ll need it for booking appointments and buying prescription drugs at the pharmacy. If the card is lost or damaged, remember to go to your local health center (centro de salud) to request a replacement immediately. You can learn more about the structure of the Spanish health card number here. What autonomous community is your health card from? Does its number format have any special features? Feel free to discuss in the comments below!