HS code classification: what it is and how to automate it

7 min read

HS code classification assigns each traded product a code from the Harmonized System, the international nomenclature that customs authorities use to determine duty rates, taxes, and controls. The first six digits are global; countries extend them to eight, ten or more digits for national tariff lines. Getting the code wrong means the wrong duty, a delayed shipment, or a penalty.

How the Harmonized System is built

The Harmonized System is maintained by the World Customs Organization and revised roughly every five years; the current edition is HS 2022. It is organised as 21 sections, 97 chapters (2 digits), headings (4 digits) and subheadings (6 digits). Those six digits are identical in every member country, which is what makes the system harmonised. Beyond six digits each country adds its own subdivisions — national tariff lines — to which the actual duty rates and domestic taxes attach.

Panama's Arancel Nacional de Importación, for example, extends the HS 2022 nomenclature into roughly 9,700 national tariff lines, each carrying its import duty (DAI), sales tax (ITBMS) and, where applicable, selective consumption tax (ISC). A classification is not finished at six digits; it is finished when it lands on the national line that determines what is owed.

Why classification is judgement, not lookup

If classification were a dictionary lookup — product name in, code out — it would have been automated decades ago. It is not, because the nomenclature classifies goods by what they are made of, what they do, and how they are presented, and a single product description can plausibly fit several headings. Is a heated car seat cover a textile article, a vehicle part, or an electrical heating apparatus? Each has a different rate.

The tiebreakers are the General Rules for the Interpretation of the Harmonized System, the GRI. Rule 1 says headings and the legal section and chapter notes govern. Rule 2 covers incomplete goods and mixtures. Rule 3 handles goods that could fall under two or more headings — most specific description first, then essential character, then the heading that comes last in numerical order. Rules 4 to 6 deal with goods not elsewhere covered, packaging, and subheading-level classification. A defensible classification cites the rule it relied on.

Then there are the legal notes: chapter and section notes that include or exclude specific goods from a heading regardless of what the heading text seems to say. A classifier that reads heading titles and ignores the notes will be confidently wrong on a predictable set of products.

Where classification goes wrong in practice

Most misclassification is not a hard GRI 3 case. It is a routine product described badly. The commercial invoice says "parts" or "samples" or a brand name, and the person classifying either guesses or stops to ask. The description is the raw material of classification, and it is usually the weakest input in the process.

  • Vague descriptions on the commercial invoice — a brand or model number with no statement of what the item is or is made of.
  • Mixed shipments where one invoice line covers several distinct products that classify differently.
  • Relying on the supplier's declared HS code, which was classified under a different country's tariff and possibly for a different purpose.
  • Reusing last year's code after an HS edition change moved the product.
  • Ignoring the chapter notes and classifying from the heading title alone.
  • No record of why a code was chosen, so the same product is classified three ways by three people.

What responsible automation looks like

The goal is not a machine that classifies unsupervised. Customs law places the declaration on the importer or the licensed broker, and it will keep doing so. The goal is a system that proposes a classification with its reasoning, at the moment the shipment paperwork is processed, so the specialist reviews rather than researches.

  • Start from the extracted goods description, verbatim, plus any material, function and composition details on the invoice or packing list.
  • Classify against the national tariff — the full set of national lines with their rates — not just the six-digit HS, and against the current edition.
  • Apply the legal chapter and section notes and the GRI, and record which rule and which note decided the case.
  • Return a code, a confidence, and the reasoning; route low-confidence or high-value lines to a broker for review before the declaration is filed.
  • Keep an audit trail per classification. When customs queries a code two years later, the reasoning is the defence.
  • Learn from the broker's corrections: a product classified once should be classified the same way next time.

Where Tavnit fits

Tavnit extracts the shipment document set — commercial invoice, packing list, bill of lading, certificate of origin — into typed fields, then an HS code Cleaner classifies each goods line from its extracted description during the same run. For Panama, the classifier works over the official Arancel Nacional (VII Enmienda, HS 2022) with its national lines and DAI, ITBMS and ISC rates, applying the legal chapter notes and the GRI, so the output is a national tariff line with reasoning rather than a six-digit guess.

Classifications route through Human-in-the-Loop review before anything is filed, with an append-only audit trail of who approved which code. The structured, classified data can then pre-fill the declaration form rather than being retyped into it.

Common questions

What is the difference between an HS code and a tariff code?
The HS code is the six-digit international code defined by the World Customs Organization. A tariff code is a country's extension of it — eight, ten or more digits — to which the national duty and tax rates attach. Panama's Arancel Nacional, the EU's TARIC and the US HTS are all national tariffs built on the HS.
Can AI classify HS codes accurately?
It can propose classifications well when it works from a good product description, against the full national tariff with its legal notes, and explains its reasoning. It should not file declarations unsupervised: the responsible approach is a proposal with confidence and reasoning, reviewed by a licensed broker for low-confidence or high-value lines.
Can I just use the HS code my supplier put on the invoice?
Treat it as a hint, not an answer. The supplier classified under their own country's tariff, possibly for export controls rather than import duty, and possibly under an older HS edition. The importer or broker is responsible for the code on the import declaration.

More guides

Try it on one document

Build a flow, send a real document through it, and see what comes back. Free credits to start.

Start free