Certidão matrícula generator and validator
Brazilian civil-registry certificates (certidões of birth, marriage and death) carry a 32-digit matrícula that identifies the registry office, book, page and entry. Generate fictitious matrículas with computed check digits to test registry, benefits and onboarding systems without real records.
Up to 1000 items at once. Everything is generated in your browser.
How to use
- On the generator tab, choose the type: birth (nascimento), marriage (casamento), death (óbito) or any (picked at random among the three).
- Tick With mask (punctuation) to separate the blocks with spaces, e.g.
558121 01 55 2012 1 00066 159 0021957 45, or untick it for 32 plain digits. - Click Generate, then Copy. For batches, set the Quantity (1–1000) and use Export CSV, Export JSON or Export SQL.
- On the Validate tab, paste one or many matrículas, one per line. Spaces, dots, hyphens and slashes are ignored.
- Each line shows whether it is valid, with book type, year and registry-office code (CNS), or why it failed: characters, length, repeated digits, service code, book type, year or check digits.
How it works
Where the matrícula comes from
Since 1 January 2010, every certificate issued by a Brazilian civil registry office (Registro Civil das Pessoas Naturais) must show a 32-digit matrícula. The layout was set by Provimentos 2/2009 and 3/2009 of the National Justice Council’s inspectorate (CNJ), later replaced by Provimento 63/2017 and now consolidated in the National Code of Rules (Provimento 149/2023). The block layout stayed the same.
| Positions | Block | Example |
|---|---|---|
| 1–6 | CNS: national code of the registry office | 558121 |
| 7–8 | Collection: 01 own, 02 incorporated | 01 |
| 9–10 | Service: always 55 (civil registry) | 55 |
| 11–14 | Registration year | 2012 |
| 15 | Book type | 1 |
| 16–20 | Book number | 00066 |
| 21–23 | Page | 159 |
| 24–30 | Entry (termo) | 0021957 |
| 31–32 | Check digits | 45 |
Accepted book types: 1 Book A (birth), 2 Book B (marriage), 3 Book B Auxiliary (religious marriage with civil effect), 4 Book C (death), 5 Book C Auxiliary (stillbirth), 6 Book D (banns), 7 Book E (other acts), 8 Book E split for emancipations and 9 Book E split for interdictions (the last two listed in Provimento 3/2009). The generator uses types 1, 2 and 4 only, collection 01, a year from 1975 to the current one, and a CNS without a leading zero.
Check-digit calculation
Provimento 3/2009 only says that digits 31 and 32 are produced by a program the CNJ distributes to registry offices; the formula is not in the text. The rule below is the one used by registry software and open-source validators, and it is what this page implements:
- First digit: multiply the first 30 digits by the weights 2, 3, 4… 31, add them and take the remainder modulo 11.
- Second digit: multiply all 31 digits (including the first check digit) by the weights 1, 2, 3… 31, add and take the remainder modulo 11.
- In both cases a remainder of 10 becomes 1; any other remainder is the digit itself.
Worked example: 558121 01 55 2012 1 00066 159 0021957 ??
First digit, products added per block: CNS 81 + collection 9 + service 105 + year 68 + type 16 + book 246 + page 353 + entry 710 = 1588. 1588 mod 11 = 4 → 4.
Second digit: CNS 59 + collection 8 + service 95 + year 63 + type 15 + book 234 + page 338 + entry 686 + first digit 4×31 = 124, total 1622. 1622 mod 11 = 5 → 5.
Full matrícula: 55812101552012100066159002195745.
FAQ
Does a valid result mean the certificate exists?
No. The tool checks the structure, the 55 service code, the book type, the year and both check digits. Whether the record exists and the certificate is authentic can only be confirmed with the issuing registry office or official civil-registry channels, which this tool does not query.
Why do you say the formula is not official?
Because the CNJ provimentos describe the blocks but leave the check digits to a program distributed to registry offices, without publishing the calculation. The rule used here is the one adopted by registry software and open libraries. For formal assurance, confirm with the registry office or the state inspectorate.
My certificate ends in XX. Is that an error?
Provimento 3/2009 allowed offices without a computer to write "xx" instead of the check digits. It is rare, but it appears on some older certificates. This validator accepts digits only and rejects those cases as invalid characters, so handle them separately in your system.
How should I store the matrícula?
Use a 32-character text column such as CHAR(32), without spaces. As a number it loses leading zeros and overflows common integer types. If you need to filter by type or year, extract position 15 and positions 11–14 into their own columns.
Can I use these numbers in real processes?
No. They are fictitious and meant for automated tests, staging, demos and fixtures. The generated CNS is random and may match a real registry office, but the record does not exist. Using these numbers in real applications or sign-ups is improper.
Sources
- CNJ — Provimento 2/2009, certificate models (Portuguese)
- CNJ — Provimento 3/2009, matrícula layout (Portuguese)
- CNJ — Provimento 63/2017 (Portuguese)
- CNJ — Provimento 149/2023, National Code of Rules (Portuguese)
Related tools
Updated 2026-11-13 · Rafael Lima