Pix key validator

Paste one or more keys and find out the type of each one, the normalized form that goes inside the QR code and whether the CPF and CNPJ check digits match. Nothing is sent.

CPF, CNPJ, email, phone or random key. Up to 50 lines. Nothing is sent.

What is a Pix key validator?

A Pix key validator is a tool that checks whether a piece of text has the format of a legitimate Pix key and identifies its type: CPF, CNPJ, email, mobile phone or random key (EVP). For CPF and CNPJ it recalculates the check digits, which rules out most typos; for phone numbers and emails it returns the normalized form that is written in field 26-01 of the BR Code. It does not query the Central Bank of Brazil (BCB) or any bank: a key with a valid format may not be registered, and only the payer's app finds that out at payment time.

The five Pix key types

Key typeFormat in the code (field 26-01)Example
CPF11 digits, no dots or dash12345678909
CNPJ14 digits, no punctuation11222333000181
EmailAs registered, up to 77 charactersloja@exemplo.com.br
Mobile phone+55, area code and number (E.164 format)+5511912345678
Random key (EVP)36-character UUID generated by the bank123e4567-e12b-12d1-a456-426655440000

How the validator decides the type

  1. Random key: 32 hexadecimal digits separated by hyphens in the 8-4-4-4-12 pattern. It is always recognised first.
  2. Email: contains an @ and a dot in the domain, up to 77 characters.
  3. Punctuated CPF and CNPJ: 000.000.000-00 and 00.000.000/0000-00 are handled by type and have their check digits verified.
  4. Phone: starts with +55 or 55 and has 12 or 13 digits, or has 11 digits with the area code and the leading 9 of a mobile number.
  5. Digits only: 11 digits with a valid check digit are a CPF; 14 digits with a valid check digit are a CNPJ; otherwise the validator reports which check failed.

Worked example: CPF check digits

Take the sample CPF 529.982.247-25. The first nine digits are multiplied by 10, 9, 8 … 2 and added up: 5×10 + 2×9 + 9×8 + 9×7 + 8×6 + 2×5 + 2×4 + 4×3 + 7×2 = 295. The remainder of 295 × 10 divided by 11 is 2, the first check digit. Repeating with ten digits and weights from 11 down to 2, the result is 5, the second digit. Since 25 matches, the validator accepts the key and shows the normalized form 52998224725, which is how it goes in the code. Change the ending to 26 and the result becomes "Invalid CPF". The CNPJ follows the same idea with weights 5,4,3,2,9,8,7,6,5,4,3,2 and then 6,5,4,3,2,9,8,7,6,5,4,3,2.

Common mistakes the validator catches

InputResultWhy
529.982.247-26Invalid CPFCheck digits do not match (one digit swapped)
11 1234-5678Not recognized8-digit landline; a Pix key uses a 9-digit mobile number
nome@emailNot recognizedDomain is missing a dot
11.222.333/0001-81Valid CNPJ → 11222333000181Punctuation removed for the code
Fulano@Example.comEmail → fulano@example.comNormalized to lowercase

What to do after validating

If the key is yours, generate the code in the Pix QR code generator; the generator uses the same detection and shows the type in real time as you type. If the key belongs to someone else, start a Pix in your app with that key and check the name shown on the confirmation screen before completing; that is the only registration check that exists. To inspect a whole code instead of just the key, use the Pix decoder.

References

Key types and formats: Central Bank of Brazil (BCB), Pix and Manual de Padrões para Iniciação do Pix; CPF and CNPJ check digits per the public algorithms of the Receita Federal (modulo 11); phone numbers per ITU-T E.164; random key per RFC 4122 (UUID).

Questions about the key validator

Does a valid format mean the key exists?

No. The validator only checks that the key has the format of one of the five types and, for CPF and CNPJ, that the check digits are correct. Only the payer's app queries the DICT to find out whether the key is registered and who it belongs to.

How should the phone number be written?

Inside the Pix code the phone number goes in international E.164 format: +55, area code and number, no spaces, for example +5511912345678. The validator accepts (11) 91234-5678 and returns the normalized form.

Can a landline be a Pix key?

The standard specifies a mobile phone number. The validator recognises 11-digit national numbers starting with the mobile 9; other numbers come back as unrecognized format.

Is an email with capital letters the same key?

The validator converts the email to lowercase, which is the usual form at registration. If you registered it with capitals, use the exact form shown in your app when generating the code.

What is a random key or EVP?

It is a 36-character UUID (universally unique identifier) generated by the bank at the user's request, such as 123e4567-e12b-12d1-a456-426655440000. It lets you receive payments without exposing your CPF, phone number or email.

Can I validate several keys at once?

Yes, one per line, up to 50. It is handy for checking a spreadsheet of suppliers or payees before generating codes or setting up payments.