1001Ferramentas
🧾 Validators

CFOP Validator

Validate a Brazilian CFOP code (fiscal operations code) by checking its 4 digits and prefix. Essential for issuing correct invoices (notas fiscais) in Brazil.

What the four CFOP digits actually mean

You are putting together a Brazilian invoice and the accountant sent a four digit code over chat: 5.102. Before typing it into the issuing software, you want to be sure it makes sense. Is it an inbound or an outbound operation? Does it cover a sale inside the state or across state lines? Getting the first digit wrong is the kind of mistake SEFAZ rejects on the spot, or worse, lets through and turns into an ICMS headache months later.

The check strips dots and dashes, then looks at the leading digit, which carries the nature of the operation: 1, 2 and 3 are inbound (same state, another state, abroad) and 5, 6 and 7 are the matching outbound codes. Notice that no CFOP starts with 4, 8 or 9, so typing 4102 returns an unrecognized prefix message. The first two digits are displayed apart from the last two purely to make the code easier to read.

The part that matters: this checks the shape of the code, not whether it exists. Something like 5000 passes as valid because it has four digits and an accepted prefix, even though the official table has no such entry. Use it to catch typos and inbound versus outbound mixups, then confirm the exact meaning (5102 is a resale of goods bought from third parties) in the official CFOP table or with your accountant. Everything runs in your browser.

Frequently asked questions

What does the first CFOP digit mean?
It tells you whether the operation is inbound or outbound and where it comes from or goes to: 1 is inbound within the same state, 2 inbound from another state, 3 inbound from abroad, and 5, 6 and 7 are the outbound equivalents.
Does it show what the operation is?
No. It checks the four digits, identifies the prefix and shows how the code splits, but it does not carry the operation description. You still need the official CFOP table for that.
Can I type the code with a dot, like 5.102?
Yes. Dots, dashes and spaces are discarded before the check, so 5.102 and 5102 give the same answer.

Related Tools