Brazil CFOP and NCM Codes: A Practical Guide for Invoice Recipients

Published
Updated
Reading Time
22 min
Author
David
Topics:
Tax & ComplianceBrazilCFOP codesNCM classificationNF-eMercosur
Brazil CFOP and NCM Codes: A Practical Guide for Invoice Recipients

Learn how to decode CFOP and NCM codes on Brazilian invoices. Practical reference tables and structural breakdowns from the invoice recipient's perspective.

Every line item on a Brazilian invoice carries two codes that foreign recipients rarely encounter elsewhere: CFOP and NCM. If you work in accounts payable, finance, or import/export and have just received a Brazilian NF-e (Nota Fiscal Eletrônica) for the first time, these codes probably look like opaque strings of digits. They are not decorative. They are legally mandated fields that directly control how taxes are calculated on every transaction.

CFOP (Código Fiscal de Operações e de Prestações) is a 4-digit code that identifies the nature and tax treatment of a transaction. Its first digit tells you the direction and geographic scope of the operation: digits 1 through 3 indicate inbound operations (1 for intrastate, 2 for interstate, 3 for international imports), while digits 5 through 7 indicate outbound operations (5 for intrastate, 6 for interstate, 7 for international exports). A single glance at the first digit tells you whether you are looking at a purchase, a sale, a return, a transfer between branches, or something else entirely.

NCM (Nomenclatura Comum do Mercosul) is an 8-digit product classification code. The first 6 digits follow the internationally recognized Harmonized System (HS), the same framework used by customs authorities worldwide. The final 2 digits are Mercosur-specific subdivisions that provide additional granularity for trade within the South American bloc. NCM identifies what is being sold or shipped at a product level.

Both codes appear on every line item of a Brazilian NF-e, the country's mandatory electronic invoice system. They are not optional metadata or internal reference numbers that a supplier adds for their own bookkeeping. Brazilian tax authorities require them, and automated validation systems reject invoices where they are missing or inconsistent. For the recipient, this means the codes on your invoice have already passed through a government validation layer before reaching you.

Why should you, as the person receiving the invoice, care about codes that your Brazilian supplier is responsible for populating? Because these codes determine the tax obligations attached to the transaction, including whether withholding taxes apply, which tax rates govern the goods, and how the transaction should be classified in your own records. A misread CFOP can lead you to record a sale as a return. A mismatched NCM can mean the wrong tariff rate on an import. When your auditors or tax advisors ask about a Brazilian transaction, CFOP and NCM are the first things they will want to see.

The complexity here is not accidental. According to an analysis by RSM International of World Bank data on Brazil's tax compliance burden, Brazilian businesses spend an average of 1,501 hours per year fulfilling tax obligations. That is five times the average across Latin America and the Caribbean, and nearly ten times the average for OECD high-income countries. CFOP and NCM codes sit at the heart of this system: CFOP tells you the type of operation (a sale, a return, a transfer, a consignment), NCM tells you the product, and together they determine the complete tax treatment that applies to each line item on the invoice.

This guide breaks down both code systems from the perspective of someone reading a Brazilian invoice rather than issuing one. The sections that follow explain how to decode each code's structure, which codes you will encounter most frequently, how the two systems interact to drive tax calculations, and what other classification codes on the NF-e mean for your records.


How to Read a CFOP Code

Every CFOP is a four-digit code, and each digit position carries specific meaning. Once you understand the structure, you can decode any CFOP you encounter on a Brazilian invoice without memorizing all 500+ entries in the official table.

The First Digit: Direction and Geographic Scope

The first digit is the most important. It tells you two things at once: whether the transaction is inbound (a purchase or receipt) or outbound (a sale or shipment), and whether it crosses state or national borders.

First DigitDirectionGeographic Scope
1.xxxInboundIntrastate (within the same state)
2.xxxInboundInterstate (from another Brazilian state)
3.xxxInboundInternational (imports)
5.xxxOutboundIntrastate (within the same state)
6.xxxOutboundInterstate (to another Brazilian state)
7.xxxOutboundInternational (exports)

The Remaining Three Digits: Operation Type

The last three digits identify the specific type of commercial operation. These are standardized across the inbound/outbound pairs, which means the operation suffix stays consistent regardless of direction. For example, the suffix .102 always refers to "sale of goods acquired from third parties," whether the first digit is 1, 2, 5, or 6.

This pairing system is critical for invoice recipients. The NF-e you receive will typically show the issuer's outbound CFOP (a 5.xxx, 6.xxx, or 7.xxx code), but when you record that transaction in your own books and file your SPED EFD tax obligations, you need the corresponding inbound code (1.xxx, 2.xxx, or 3.xxx). The operation suffix stays the same; only the first digit changes.

Worked Examples

CFOP 5.102 — The first digit 5 means outbound, intrastate. The suffix .102 means "sale of goods acquired from third parties." So this is an intrastate sale of purchased merchandise. If you are the buyer and both you and the seller are in São Paulo, you would record this as CFOP 1.102 in your own filings.

CFOP 6.102 — Same operation (.102), but the first digit 6 signals an interstate transaction. The seller shipped goods across state lines to reach you. Your corresponding inbound code would be CFOP 2.102.

CFOP 5.401 — The first digit 5 again indicates an outbound intrastate transaction. The suffix .401 identifies a sale of goods subject to ICMS-ST (ICMS tax substitution), where the seller has already collected ICMS on behalf of the entire supply chain. This distinction matters because it changes whether you can claim ICMS input credits on the purchase.

Why CFOP Matters When You Are the Recipient

Even though the seller assigns the CFOP on the invoice, the code has direct consequences for your tax position:

  • ICMS rate and treatment. The CFOP determines which ICMS rules apply. An interstate purchase (2.xxx) may involve ICMS rate differentials between states, while an import (3.xxx) triggers a separate ICMS calculation on customs clearance.
  • Input credit eligibility. Not all CFOPs entitle you to claim ICMS credits. Operations coded under tax substitution (like the .401 suffix) or certain exempt categories restrict your ability to offset ICMS paid against ICMS collected.
  • SPED EFD filings. Brazil's digital tax reporting system, SPED EFD, requires you to log every incoming invoice with the correct inbound CFOP. A mismatch between the CFOP you report and the actual nature of the operation is one of the most common triggers for tax authority audits.
  • Audit risk. State tax authorities (SEFAZs) cross-reference the seller's outbound CFOP against the buyer's inbound CFOP electronically. Inconsistencies between the two are flagged automatically.

Maintaining the CFOP Table

The complete CFOP table is maintained by CONFAZ (Conselho Nacional de Política Fazendária), the council that coordinates tax policy across Brazil's 26 states and the Federal District. The table contains over 500 codes, but in practice most companies regularly encounter only a few dozen that match their typical purchasing patterns. The full table is published through state SEFAZ portals, where you can search by code number or operation type. The common codes you are most likely to see on incoming invoices are covered in the next section.

Brazil's ongoing tax reform (Reforma Tributária) will also reshape how some of these codes function as new consumption taxes gradually replace ICMS and other existing levies. For a deeper look at how the 2026 Reforma Tributária changes the codes on Brazilian invoices, see our companion guide on the subject.

Common CFOP Codes on Brazilian Invoices

The full CFOP table maintained by Brazil's tax authorities contains over 500 entries, but most invoice recipients regularly encounter only a few dozen. The reference below covers the code groups that appear most frequently on supplier invoices, organized by operation type.

Remember the first-digit logic from the previous section: on outbound invoices issued by your supplier, codes beginning with 5 indicate intrastate sales, 6 indicate interstate sales, and 7 indicate international exports. As the recipient booking inbound transactions, the corresponding codes use 1 (intrastate), 2 (interstate), or 3 (international import). The "x" in the table below represents this variable first digit.

CFOP CodeOperation TypePlain-English DescriptionWhen You Will See It
x.101Standard sale — manufactured goodsSale of a product that the supplier manufactured or produced in-housePurchasing raw materials or finished goods directly from the manufacturer
x.102Standard sale — third-party goodsSale of a product the supplier purchased from another party and is resellingPurchasing from distributors, wholesalers, or trading companies
x.401Sale under ICMS-ST (tax substitution)Sale where the supplier is responsible for collecting ICMS on behalf of the entire downstream supply chainBuying from a manufacturer or importer designated as the ICMS-ST substitute taxpayer for that product category
x.403Sale of goods already subject to ICMS-STSale where the ICMS-ST was collected at an earlier stage in the supply chain, not by this particular supplierBuying from a reseller whose upstream supplier already paid the substitution tax
x.501Sale with ICMS-ST previously retained — manufactured goodsSale of a self-manufactured product for which ICMS-ST was already collected earlierRarely encountered; indicates the manufacturer already pre-paid the substitution tax on this product before selling to you
x.502Sale with ICMS-ST previously retained — third-party goodsSale of a resold product for which ICMS-ST was already collected upstreamPurchasing goods in product categories covered by state-level ICMS-ST agreements (e.g., beverages, auto parts, pharmaceuticals)
x.901Remittance for industrializationShipment of materials sent to a third party for outsourced manufacturing or processingWhen a business partner ships materials to your facility for contracted processing or manufacturing
x.902Return of industrializationReturn of processed or transformed goods back to the party that sent the original materialsReceiving finished or semi-finished goods back after outsourced manufacturing is complete
x.949Other outbound operations not elsewhere specifiedCatch-all code for outbound movements that do not fit any specific CFOP categoryMiscellaneous shipments such as samples, warranty replacements, or transfers that lack a dedicated code

ICMS-ST Codes in Practice

The x.401 through x.502 range deserves particular attention. Substituição Tributária (ICMS-ST) is a mechanism where one participant in the supply chain, usually the manufacturer or importer, collects the ICMS tax that would otherwise be due at every subsequent resale. When you see these codes on an incoming invoice, the tax treatment differs significantly from a standard x.101 or x.102 transaction. The ICMS base and collected amounts on the invoice will reflect the substitution regime rather than standard rates, which directly affects how you book the tax credit (or lack thereof) on your end.

Working With a Recurring Subset

In practice, companies that operate within a specific industry or product category will see the same handful of CFOP codes repeatedly. A pharmaceutical distributor, for example, will encounter x.403 and x.502 far more often than x.901. An automotive parts importer will see a concentration of x.401 codes. Once you identify the codes that recur in your particular supply chain, monitoring them becomes routine.

The critical point is verification: if a CFOP code on a received invoice does not match the actual nature of the transaction, flag it immediately with the issuing party. An incorrect CFOP leads directly to wrong tax calculations and creates mismatches in SPED fiscal reporting, the digital bookkeeping system that cross-references buyer and seller records. Catching a misclassified CFOP before you book the invoice is far simpler than correcting it after the tax filing period closes.


How to Read an NCM Code

NCM stands for Nomenclatura Comum do Mercosul (Common Nomenclature of Mercosur), and it appears as an 8-digit product classification code on every line item of a Brazilian NF-e. Where CFOP describes the purpose of a transaction, NCM identifies what is being sold or shipped. If you work with customs classifications elsewhere in the world, the structure will look familiar because NCM is built directly on the international Harmonized System.

The 8 digits break down into four hierarchical levels:

  • Digits 1–2 (Chapter): The broadest product category. There are roughly 100 chapters covering everything from live animals (Chapter 01) to works of art (Chapter 97). Chapter 84, for example, covers machinery and mechanical appliances.
  • Digits 3–4 (Position): A subcategory within the chapter that narrows the product type. Within Chapter 84, position 71 identifies automatic data processing machines.
  • Digits 5–6 (Subposition): A more specific product group within the position. Subposition 30 under 84.71 refers to portable data processing machines.
  • Digits 7–8 (Mercosur Item): The final two digits are specific to the Mercosur trade bloc (Brazil, Argentina, Uruguay, and Paraguay). These digits do not exist in the global HS system and provide an additional layer of classification used for regional tariff and tax purposes.

The first six digits of any NCM code are identical to the corresponding HS code used worldwide. This means that anyone familiar with HS classifications from international trade can immediately recognize the product category from digits 1 through 6. Only the final two digits require Mercosur-specific knowledge.

Worked example: Take NCM code 8471.30.19.

DigitsLevelValueMeaning
84ChapterMachinery and mechanical appliancesBroad product family
71PositionAutomatic data processing machinesProduct subcategory
30SubpositionPortable machinesSpecific product group
19Mercosur ItemOtherRegional classification

This code represents laptop computers. An invoice recipient seeing 8471.30.19 on a Brazilian NF-e line item can confirm that the goods described are portable computing devices.

Common NCM Chapters at a Glance

The full NCM table contains thousands of codes, but most invoices you receive will fall within a handful of product chapters. The table below lists the chapters that appear most frequently on commercial invoices:

ChapterProduct CategoryCommon Examples
22Beverages, spirits, and vinegarBottled water, soft drinks, beer, wine
27Mineral fuels and oilsDiesel, gasoline, lubricants
30Pharmaceutical productsMedications, vaccines, medical preparations
39Plastics and articles thereofPackaging, tubes, plastic containers
48Paper and paperboardOffice paper, cardboard, labels
72Iron and steelSteel bars, sheets, structural steel
84Machinery and mechanical appliancesEngines, pumps, computers, printers
85Electrical machinery and equipmentCables, transformers, phones, batteries
87Vehicles and partsCars, trucks, automotive parts
90Optical, measuring, and medical instrumentsSensors, meters, medical devices

When you encounter an NCM code, the first two digits immediately tell you which chapter the product belongs to. From there, the remaining digits narrow the classification. This table is not exhaustive, but it covers the product categories that account for the bulk of commercial invoicing in Brazil.

NCM classification matters because it directly determines tax treatment across multiple dimensions. The assigned NCM code controls import duty rates at customs, dictates whether the product falls under ICMS-ST (tax substitution, where the manufacturer or importer collects tax on behalf of the entire supply chain), sets the applicable IPI (federal excise tax) rate, and influences PIS/COFINS contribution calculations. Two similar products assigned different NCM codes can face materially different effective tax rates, which is why verifying the correct code on each invoice line item is worth the effort.

One practical consideration: Brazil's federal tax authority (Receita Federal) periodically revises the NCM table and publishes the current version through the SISCOMEX portal. Products may be reclassified under new codes, entirely new codes may be introduced for emerging product categories, and deprecated codes are phased out. International teams receiving Brazilian invoices should monitor these revisions, particularly around the start of each calendar year when updates most commonly take effect. If you are unfamiliar with the broader structure of Brazilian invoice fields beyond NCM, a complete guide to reading and verifying invoice fields covers the full layout from header to line-item detail.


NCM Misclassification: Penalties and Common Pitfalls

Getting an NCM code wrong is not a minor administrative error. Brazilian tax authorities treat classification mistakes as a compliance failure with real financial consequences, and the penalties scale depending on whether the error looks like negligence or intent.

For imports, the Receita Federal applies a 1% fine on the declared customs value when an NCM code is incorrect, with a minimum penalty of R$500. That baseline fine applies even when the misclassification had no effect on the taxes owed. If the wrong NCM code resulted in underpaid taxes, the penalty jumps to 75% of the tax difference. And in cases where authorities determine the misclassification was deliberate, the fine reaches 150% of the unpaid tax amount.

Beyond the fines themselves, an incorrect NCM code on an import declaration can halt customs clearance entirely. Goods sit in port while the classification dispute is resolved, accumulating demurrage and storage charges that often exceed the original fine. For companies running lean supply chains, a single classification error can ripple into missed production schedules and contract penalties downstream.

On domestic invoices, the consequences are less dramatic but no less costly over time. Because NCM codes drive tax rates for IPI (Imposto sobre Produtos Industrializados), ICMS-ST, and PIS/COFINS, a wrong code means every tax calculation built on top of it is also wrong. A product classified under an NCM heading with a 5% IPI rate instead of the correct 15% rate generates a tax shortfall on every single invoice until someone catches the mistake.

Why classification errors happen

Several patterns account for most NCM misclassifications. The first is ambiguity: many products could reasonably fall under more than one heading. A device that combines printing, scanning, and copying functions might be classified as a printer, a scanner, or a multifunction machine, each with different NCM codes and tax implications. Composite products and bundled kits present similar challenges, since the classification depends on which component defines the product's essential character.

Technology products create a second category of persistent difficulty. New products frequently have no clean fit within existing NCM categories that were designed around established product types. A wearable health monitor, for example, might be classified as medical equipment, consumer electronics, or a data processing device depending on which features the classifier emphasizes.

The NCM table itself is a moving target. Periodic updates reclassify products, add new codes, and retire old ones. A code that was correct when a supplier set up their product catalog may become invalid after a table revision, and neither party may notice until an audit flags the discrepancy.

Finally, the last two digits of the NCM code, which are Mercosur-specific extensions with no equivalent in the international HS system, create a particular trap for international teams. Staff familiar with HS classification may correctly identify the first six digits but assign the wrong national subheading simply because those final digits have no parallel in the classification systems they know.

The invoice recipient's exposure

When you receive a Brazilian invoice, the NCM codes on it flow directly into your own tax filings. Your SPED (Sistema Público de Escrituração Digital) submissions incorporate the NCM codes from inbound invoices, and if a supplier has misclassified a product, your filings inherit that error. The tax authority's audit does not distinguish between mistakes you originated and mistakes you accepted from a trading partner.

This means verifying NCM codes against the actual products or services delivered is not optional diligence. If the physical goods you received do not match the classification on the NF-e, flag the discrepancy with your supplier before booking the invoice. Correcting an NCM code before it enters your SPED records is straightforward. Correcting it after an audit has flagged the inconsistency is expensive.


How CFOP and NCM Determine Tax Treatment Together

Understanding CFOP and NCM codes individually is necessary but not sufficient. On a Brazilian invoice, these two code systems work in tandem to determine the complete tax treatment of every line item. CFOP identifies the nature of the operation: whether the transaction is a sale, return, transfer, consignment, or industrialization order. NCM identifies the product itself, down to its specific classification within the Mercosur tariff system. Together, they answer the questions that matter for tax compliance: which taxes apply, at what rates, and whether the recipient can claim tax credits.

Consider an invoice carrying CFOP 6.401, which signals an interstate sale subject to ICMS-ST (substituição tributária). The CFOP alone tells you that the supplier has collected ICMS-ST on behalf of downstream participants in the supply chain. But it does not tell you the rate. That depends on the NCM code assigned to the product, because ICMS-ST rates are set per product category and vary by state. An NCM under Chapter 22 (beverages) triggers a different ICMS-ST margin than one under Chapter 85 (electrical equipment). The CFOP establishes the tax regime; the NCM pinpoints the rate within that regime.

This interdependence extends to credit recovery. An inbound CFOP in the 1.xxx or 2.xxx range may entitle the recipient to ICMS or IPI credits, but only if the NCM classification supports it. Certain NCM categories carry tax exemptions, reduced bases, or zero rates that override what the CFOP alone would suggest. A recipient who verifies the CFOP without checking the NCM, or vice versa, risks booking incorrect tax credits and facing assessments during a fiscal audit.

Both codes feed directly into SPED EFD (Escrituração Fiscal Digital), the digital bookkeeping system administered by the Receita Federal. Every NF-e issued and received in Brazil is reported through SPED, and the tax authority cross-references CFOP and NCM data across the entire supply chain. When a supplier files an outbound invoice with CFOP 6.102 and NCM 8471.30.19, the recipient's corresponding inbound record should reflect a matching CFOP (2.102) and the identical NCM. Discrepancies between the two sides of a transaction, whether in the operation code or the product classification, generate automatic audit flags in the SPED system.

A correct CFOP paired with an incorrect NCM still produces the wrong tax calculation, and the compliance exposure falls on whoever filed the inconsistent data. This is why verifying the two codes together, rather than checking each in isolation, is the only reliable way to confirm the tax treatment on a Brazilian invoice.


Other Codes on Brazilian Invoices: CST, CSOSN, CEST, and NBS

CFOP and NCM are the two codes most immediately relevant to understanding what was sold and how the transaction is classified, but they are not the only codes on a Brazilian invoice. Several other classification codes appear on NF-e line items, each encoding a specific dimension of tax treatment.

CST (Código de Situação Tributária) is a 3-digit code that defines the ICMS tax situation for each line item. Where CFOP describes the type of operation, CST specifies two additional layers: the tax origin of the product (domestic manufacture, imported, or imported with a domestic equivalent) and the applicable taxation regime (fully taxed, exempt, deferred, suspended, with base reduction, and so on). Together, CFOP and CST give a complete picture of both the commercial operation and its ICMS tax treatment.

CSOSN (Código de Situação da Operação do Simples Nacional) replaces CST on invoices issued by companies enrolled in Brazil's Simples Nacional regime, a simplified tax framework for small businesses. When you receive an invoice from a Simples Nacional supplier, the CSOSN field appears where you would otherwise expect CST. The codes are structured differently but serve the same function: indicating how ICMS applies to that line item under the supplier's tax regime.

CEST (Código Especificador da Substituição Tributária) is a 7-digit code that identifies products subject to ICMS-ST, the tax substitution mechanism where one party in the supply chain collects ICMS on behalf of subsequent parties. While NCM classifies a product at a broad tariff level, CEST narrows the identification to the specific ICMS-ST product segment. This code is mandatory on any invoice line item where ICMS-ST applies and helps tax authorities verify that the correct substitution rules were followed.

NBS (Nomenclatura Brasileira de Serviços) is the service-sector counterpart to NCM. Where NCM classifies physical goods, NBS classifies services, intangibles, and other non-product transactions. NBS codes appear on the NFS-e (Nota Fiscal de Serviços Eletrônica), the electronic service invoice issued at the municipal level, rather than on the NF-e used for goods.

All of these codes serve the same underlying purpose: encoding tax classification data in a machine-readable format so that Brazil's federal, state, and municipal tax authorities can automate compliance verification across millions of daily transactions. For organizations that receive Brazilian invoices alongside documents from other countries, this density of coded tax information is one reason why tools that automate invoice data extraction across languages can reduce the manual effort required to process and validate each document correctly.

Invoice Data Extraction

Extract data from invoices and financial documents to structured spreadsheets. 50 free pages every month — no credit card required.

Try It Free