National Health Card (CNS) Validator

Quickly and easily validate your National Health Card (CNS)! Our CNS validator ensures the authenticity of the provided number, confirming that it is valid and error-free. If you need to generate a new CNS, try our National Health Card generator.

How CNS Validation Works

What does the validator check?

The Help4Dev CNS validator checks whether a National Health Card number is consistent with the Ministry of Health algorithm. CNS has 15 digits and its verifier is calculated based on a specific formula: the weighted sum of digits must result in a value whose remainder of division by 1045 is 0. The validator does not query the DataSUS database nor verify if the CNS belongs to a real patient.

When is a CNS considered invalid?

A CNS is invalid when: (1) it does not have exactly 15 digits; (2) it does not start with 1, 2, or 7 (valid categories); (3) the weighted sum of digits does not result in remainder 0 when divided by 1045. CNS starting with 7 follows a different generation logic (provisional) and has a specific verification formula. The validator covers both cases.

Why validate CNS in development?

Hospital systems, electronic records, telemedicine platforms, and DataSUS integrations need to validate CNS as a mandatory patient identification field. Testing these systems requires both valid and invalid CNS to ensure the validation logic works correctly. The Help4Dev validator offers instant CNS verification without exposing real patient data.