CST IBS/CBS
Código de Situação Tributária of the IBS and the CBS, the taxes of the consumption tax reform (LC 214/2025).
Validate
Checks whether a CST-IBS/CBS code (Código de Situação Tributária of the IBS and the CBS) exists in the official table. It is the code the CST field of the IBSCBS group carries in the electronic fiscal documents of the tax reform (NF-e, NFC-e, CT-e, NFS-e and others), and the check behind NF-e rejection 1020.
- Accepts a string of bare digits, with optional surrounding whitespace, or a non-negative safe integer. A value shorter than 3 digits is left-padded with zeros, as a string or as a number, since the codes start with zeros a numeric field drops:
0,"0"and"000"are all the code000, and10and"10"are010. - Any other string is rejected (
"cst200","2.00"). The function does not extract its digits. A negative or fractional number is invalid. - The table published on 2026-06-23 has 18 codes: 000, 010, 011, 200, 220, 221, 222, 400, 410, 510, 515, 550, 620, 800, 810, 811, 820 and 830. CST 220 stays valid, although its classifications were excluded (see
classTrib.isValid). - The IBS and the CBS share this table. It is separate from
cst.isValidbecause its 3-digit codes collide with the ICMS CST, andcst.isValidwithout ataxaccepts a code of any table, so adding these codes would change what that default accepts.
| Parameter | Type | Required |
|---|---|---|
value | string | number | yes |
| returns | boolean |
Check if a CST-IBS/CBS (Código de Situação Tributária do IBS e da CBS) exists in the official table, the code the field CST of the group IBSCBS carries in the electronic fiscal documents of the tax reform (Lei Complementar nº 214/2025): NF-e, NFC-e, CT-e, NFS-e and the others.
- The codes in force are
000,010,011,200,220,221,222,400,410,510,515,550,620,800,810,811,820and830. - It is a function of its own, not a
taxofisValidCst: IBS and CBS share one table, its 3 digit codes collide with the ICMS origin plus Tabela B form (000,200), andisValidCstwithout ataxaccepts a code of any table, so adding this one would change what that default accepts. - Accepts a string of bare digits with optional surrounding whitespace, or a non-negative safe integer. The field is numeric with 3 digits and has no mask, so any other string is rejected instead of having its digits picked out.
- A value narrower than 3 digits is left padded with zeros, as a string or as a number, since the codes start with zeros a numeric field drops:
0,'0'and'000'are all the code000.
import { isValidCstIbsCbs } from '@brazilian-utils/brazilian-utils';
isValidCstIbsCbs('000'); // true
isValidCstIbsCbs(410); // true
isValidCstIbsCbs(10); // true (padded to '010')
isValidCstIbsCbs('100'); // false
isValidCstIbsCbs('cst200'); // false (not a documented form)
isValidCstIbsCbs(-200); // false (not a non-negative safe integer)Try it with JavaScript isValidCstIbsCbs
Shared test cases (25) and the result in each library cstIbsCbs.isValid
Look up
Looks up a CST-IBS/CBS code in the official table and returns its code and description.
- Same input rules as
cstIbsCbs.isValid. Returnsnullexactly when that function returnsfalse. - The returned code has 3 digits, padded with zeros. The description is the text of the CST sheet of the official table.
| Parameter | Type | Required |
|---|---|---|
value | string | number | yes |
| returns | CstIbsCbs | null |
Look a CST-IBS/CBS up and get the description the official CST table gives it. The result is a CstIbsCbs record: { code, description }.
- Same table and input rules as
isValidCstIbsCbs. Returnsnullwhen the code is unknown or the value is not in a documented form.
import { getCstIbsCbs } from '@brazilian-utils/brazilian-utils';
getCstIbsCbs('000'); // { code: '000', description: 'Tributação integral' }
getCstIbsCbs(410); // { code: '410', description: 'Imunidade e não incidência' }
getCstIbsCbs(10); // { code: '010', description: 'Tributação com alíquotas uniformes' }
getCstIbsCbs('100'); // null
getCstIbsCbs('cst200'); // null (not a documented form)Try it with JavaScript getCstIbsCbs
Shared test cases (23) and the result in each library cstIbsCbs.get
Official sources
- nfe.fazenda.gov.br/portal/exibirArquivo.aspx
- nfe.fazenda.gov.br/portal/exibirArquivo.aspx
- nfe.fazenda.gov.br/portal/exibirArquivo.aspx
- dfe-portal.svrs.rs.gov.br/DFE/TabelaClassificacaoTributaria
- planalto.gov.br/ccivil_03/leis/…/lcp214.htm
See also CST, cClassTrib
Last updated on
