CNS Generator
Generate valid National Health Card numbers. Excellent for your tests.
Waiting for generation...
About the CNS Generator by Type
The Box4Dev National Health Card (CNS) Generator creates valid identification numbers for the SUS, with the option to specify the type: Beneficiary (starting with 1 or 2) or Professional (provisional, starting with 7, 8, or 9). Each generated number strictly follows the DATASUS validation algorithms.
This tool is indispensable for QA and development teams in the healthcare area, allowing testing of patient and professional registrations, electronic medical record systems, and other applications.
Anatomy & Structure of Brazilian National Health Card (CNS)
The CNS comprises 15 decimal digits organized into 4 blocks (NNN NNNN NNNN NNNN):
| Position | Field | Length | Meaning & Rule | Example |
|---|---|---|---|---|
| 1 | Identifier Category | 1 digit | 1 or 2 for Permanent registration; 7, 8 or 9 for Temporary registry | 1 |
| 2 to 14 | User Registry | 13 digits | Unique health record sequence assigned by DATASUS | 2345678901234 |
| 15 | Check Digit | 1 digit | Checksum digit satisfying Modulo 11 weighted balance | 5 |
National Health Card Checksum Algorithm (DATASUS Modulo 11)
A 15-digit CNS number must satisfy the linear Modulo 11 equation:
Sum(d[i] * (15 - i)) % 11 == 0; d[0] ∈ {1, 2, 7, 8, 9}
- 1. Verify that first digit belongs to {1, 2, 7, 8, 9}.
- 2. Multiply each digit by descending positional weights from 15 to 1.
- 3. Compute total sum across all 15 products.
- 4. Evaluate remainder modulo 11.
- 5. The number is valid if and only if remainder equals 0.
Frequently Asked Questions (FAQ)
Is the generated CNS number valid?
Yes, the National Health Card (CNS) number is mathematically valid. It follows the validation algorithm defined by DATASUS. However, it is a fictitious number and is not associated with any citizen.
What is the difference between Beneficiary and Professional CNS?
The Beneficiary CNS (starts with 1 or 2) is the citizen's identification number in the SUS. The Professional CNS (starts with 7, 8, or 9) is a provisional number, often used to identify healthcare professionals in systems.
How does the tool generate the different types of CNS?
The CNS is a 15-digit number. When selecting 'Beneficiary', we generate a number starting with 1 or 2. When selecting 'Professional', we generate a provisional number starting with 7, 8, or 9.
Is it safe to generate and use this number?
Yes. Generation is done entirely in your browser and no data is stored. Usage is safe as long as it is restricted to test and development environments.