Free online tool

CNH Generator

Generate structurally valid fictional Brazilian driver license numbers for software testing.

Generate CNH

Create valid fictional data for software testing.

Generated result

The number is generated locally in your browser and is not checked against official databases.

Prefer Portuguese? Use o gerador de CNH em português.

How to use the CNH generator

Select Generate new to create another registration number, or copy the current result. Generation happens entirely in your browser, without uploads or external lookups.

What is a fictional CNH used for?

Fictional numbers help test forms, validators, APIs, imports, and staging environments without using real personal data.

A structurally valid number does not prove that a driver license exists and must not be used for real registrations or impersonation.

How are the check digits calculated?

The registration number has nine base digits and two check digits. This tool calculates them with the weight sequences and modulo 11 rules used for CNH numbers.

CNH registration number format

The generated CNH contains 11 continuous digits without dots or hyphens. This is suitable for testing fields that expect only the registration number.

Frequently asked questions

Does a generated CNH belong to a real person?

Not necessarily. The tool locally creates a fictional number with valid check digits and does not query official databases.

Can I use a generated CNH for testing?

Yes. It is intended for testing fields, validators, APIs, and staging environments.

Does a CNH registration number use punctuation?

No. The registration number is displayed as a continuous sequence of 11 digits.

How the tool works

Generate an eleven-digit fictional CNH registration number with check digits calculated from the nine-digit base. Copy the result directly into a form, test fixture, API request, or staging record.

Supported input and output

The registration number is represented as eleven continuous digits without dots or hyphens. Its two final positions use weighted modulo-11 rules, including the adjustment required by the first calculation.

Practical example

Use generated values to test required length, numeric-only fields, database constraints, validator behavior, imports, and automated scenarios without inserting a known driver’s registration number.

Common use cases

A fictional CNH number is appropriate for development and quality-assurance environments that need structurally plausible data. It also helps demonstrate masks and error handling in forms.

Limits and important checks

A valid check-digit sequence does not prove that a driver license exists or is active. The generator performs no official lookup and must not be used for real registration, identity claims, fraud, or impersonation.

Privacy and local processing

Unless the tool explicitly identifies an external lookup, input and generated output are processed in your browser and are not uploaded to CosmoTools. Avoid placing secrets in any web page and review downloaded results before using them in production.