cClassTrib

Código de Classificação Tributária of the IBS and the CBS: the 6-digit classification a document carries next to the CST-IBS/CBS.

  • Parity matrix

Validate

Checks whether a cClassTrib code (Código de Classificação Tributária of the IBS and the CBS) exists in the official table. This is the check behind NF-e rejection 1023.

  • Accepts a string of bare digits, with optional surrounding whitespace, or a safe non-negative integer. A value shorter than 6 digits is left-padded with zeros: 1 and "1" are the code 000001.
  • Any other string is rejected ("c200001", "200.001"). A negative, fractional or unsafe number is invalid.
  • The first 3 digits of a cClassTrib are its CST-IBS/CBS. options.cst checks the pair, as NF-e rejection 1024 does. It is read like cstIbsCbs.isValid reads a code. A cst that is given and does not match makes the result false, whatever its value.
  • options.cst is optional. An undefined or omitted cst checks the cClassTrib alone. A cst that is null, empty or not written as a code ("", "200001", -200) makes the result false. It is padded to 3 digits (0 and "000" are the same CST).
  • A null or non-object options is read as no options, so the cClassTrib is checked alone.
  • Only the classifications in force in the table count: one the Informe Técnico excluded by closing its validity (dFimVig) is not in it. 220001, 220002 and 220003 (excluded by v.1.60) are invalid. CST 220 itself stays valid in cstIbsCbs.isValid.
  • The table is the version published on 2026-06-23 and has 161 classifications in force. The function does not read the date: the validity was applied when the table was built.
ParameterTypeRequired
valuestring | numberyes
optionsIsValidClassTribOptionsno
options.cststring | numberno
returnsboolean

Check if a cClassTrib (Código de Classificação Tributária do IBS e da CBS) exists in the official table, the code the field cClassTrib carries next to the CST-IBS/CBS.

  • Options (IsValidClassTribOptions): cst is the CST-IBS/CBS the document carries, checked against the classification as well. Omit it to check the cClassTrib alone; a null or non-object options is read as none.
  • Every classification belongs to exactly one CST-IBS/CBS, the first 3 digits of its code, and a document that carries a cClassTrib with another CST is rejected (rejection 1024, "Classificação Tributária do IBS e da CBS incompatível com o CST informado"). A cst that is given and is not the CST of the classification, whatever it is, makes the result false.
  • Only the classifications in force count: the Informe Técnico 2025.002 excludes a classification by closing its validity (dFimVig), as v.1.60 did with 220001, 220002 and 220003, and those are rejected. 161 are in force in the version published on 23/06/2026.
  • Accepts a string of bare digits with optional surrounding whitespace, or a non-negative safe integer. The field is numeric with 6 digits and has no mask, so any other string is rejected.
  • A value narrower than 6 digits is left padded with zeros: 1, '1' and '000001' are all the code 000001. cst is read the same way, padded to 3 digits.
  • Only the code list is bundled with this function, not the descriptions getClassTrib returns.
import { isValidClassTrib } from '@brazilian-utils/brazilian-utils';

isValidClassTrib('200001'); // true
isValidClassTrib(1); // true (padded to '000001')
isValidClassTrib('200001', { cst: '200' }); // true
isValidClassTrib('200001', { cst: '000' }); // false (the classification belongs to CST 200)
isValidClassTrib('999999'); // false
isValidClassTrib('220001'); // false (excluded by Informe Técnico 2025.002 v.1.60)
isValidClassTrib('c200001'); // false (not a documented form)
Code: brazilian-utils/javascript
Try it with JavaScript isValidClassTrib
The inputs start with the first shared case. Change one to see the new result.

Runs @brazilian-utils/brazilian-utils 2.5.0 in your browser.

Shared test cases (37) and the result in each library classTrib.isValid

Look up

Looks up a cClassTrib code in the official table and returns its code, its CST-IBS/CBS, its name and its description.

  • Same input rules as classTrib.isValid without options.cst. Returns null exactly when classTrib.isValid called without options.cst returns false.
  • cst is the first 3 digits of the code: every classification belongs to one CST.
  • name is the short name the official table gives for display (the column "Nome cClassTrib") and description the situation the classification refers to (the column "Descrição cClassTrib"), both copied word for word from the official spreadsheet, on one line. The legal wording of the spreadsheet (article of Lei Complementar 214/2025 and of the regulations) is not returned.
  • The SVRS online table (Portal dos Documentos Fiscais Eletrônicos) differs from the official workbook in 5 names and 7 descriptions; the differences for 550017 and 200041 change the meaning. The function follows the workbook.
ParameterTypeRequired
valuestring | numberyes
returnsClassTrib | null

Look a cClassTrib up and get its official classification. The result is a ClassTrib record: { code, cst, name, description }.

  • Same table and the same rules for reading the code as isValidClassTrib. Returns null when the code is unknown or the value is not in a documented form.
  • The cst option exists only on isValidClassTrib, since the entry returned here already carries its CST as cst.
  • cst is the CST-IBS/CBS the classification belongs to, the first 3 digits of its code; name is the short name the official table gives for display (the column "Nome cClassTrib") and description the situation it refers to (the column "Descrição cClassTrib").
  • The legal wording the workbook also prints for each row (the article of Lei Complementar nº 214/2025 and of both regulations) is not shipped.
import { getClassTrib } from '@brazilian-utils/brazilian-utils';

getClassTrib('000002');
// {
//   code: '000002',
//   cst: '000',
//   name: 'Exploração de via',
//   description: 'Exploração de via, observado o art. 11 da Lei Complementar nº 214, de 2025.',
// }
getClassTrib(2)?.code; // '000002'
getClassTrib('999999'); // null
getClassTrib('220001'); // null (excluded by Informe Técnico 2025.002 v.1.60)
getClassTrib('c200001'); // null (not a documented form)

Source: the CST and cClassTrib sheets of the "Tabela de Classificação Tributária do IBS e CBS" workbook the Portal Nacional da NF-e publishes under "Documentos" > "Diversos" (the version published on 23/06/2026), divulged by the Informe Técnico 2025.002 (v.1.60), and the Nota Técnica 2025.002-RTC, fields UB13 and UB14.

Code: brazilian-utils/javascript
Try it with JavaScript getClassTrib
The inputs start with the first shared case. Change one to see the new result.

Runs @brazilian-utils/brazilian-utils 2.5.0 in your browser.

Shared test cases (22) and the result in each library classTrib.get

Official sources

See also CST IBS/CBS

Last updated on

On this page