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).

  • Parity matrix

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 code 000, and 10 and "10" are 010.
  • 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.isValid because its 3-digit codes collide with the ICMS CST, and cst.isValid without a tax accepts a code of any table, so adding these codes would change what that default accepts.
ParameterTypeRequired
valuestring | numberyes
returnsboolean

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, 820 and 830.
  • It is a function of its own, not a tax of isValidCst: IBS and CBS share one table, its 3 digit codes collide with the ICMS origin plus Tabela B form (000, 200), and isValidCst without a tax accepts 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 code 000.
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)
Code: brazilian-utils/javascript
Try it with JavaScript isValidCstIbsCbs
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 (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. Returns null exactly when that function returns false.
  • The returned code has 3 digits, padded with zeros. The description is the text of the CST sheet of the official table.
ParameterTypeRequired
valuestring | numberyes
returnsCstIbsCbs | 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. Returns null when 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)
Code: brazilian-utils/javascript
Try it with JavaScript getCstIbsCbs
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 (23) and the result in each library cstIbsCbs.get

Official sources

See also CST, cClassTrib

Last updated on

On this page