National Health Card (CNS) Generator

Try our National Health Card (CNS) generator! You can create various valid numbers and customize your experience using the automatic rotation to generate new CNS based on the selected time. Additionally, you can choose whether or not to include the punctuation between the digits.

Also, be sure to check out our CNS validator which ensures the authenticity of the generated numbers. It’s quick and easy!

This tool generates fictitious data intended exclusively for software testing and development purposes. The data does not correspond to real people or entities and must not be used for illegal, fraudulent purposes, or in ways that violate the privacy of others. Compliant with LGPD (Brazilian Data Protection Law).

Understanding CNS (National Health Card) and the Generator Algorithm

What is the National Health Card (CNS)?

The Cartão Nacional de Saúde (CNS), also known as Cartão SUS, is the user identification document in Brazil's Unified Health System. It has 15 digits and is issued by the Ministry of Health. Each Brazilian who uses SUS has a unique CNS, linked to their CPF. CNS is required for SUS appointments, vaccines, hospitalizations, surgeries, and high-cost medication dispensing.

How does the generation algorithm work?

CNS starts with digits 1, 2, or 7 (depending on the category). For CNS starting with 1 or 2, the number is derived from PIS/PASEP and date of birth. For test generation purposes, the algorithm verifies the number's consistency through a specific formula: the 11-digit PIS base generates a 15-digit CNS through weighted sums, verifying that the number has remainder 0 when divided by 1045.

Why use fictional CNS numbers in development?

Hospital systems, electronic health records, telemedicine platforms, DataSUS integrations, and pharmacy systems use CNS as the main patient identifier. In developing and testing these applications, having valid CNS numbers that pass format checks is necessary. Numbers generated by Help4Dev are completely fictitious and protect the privacy of real patients.