ANNOTATED SAMPLE

CNAB400 — one detail record from a Brazilian collection file

One 400-character detail record from a remessa de cobrança, the file a Brazilian company sends its bank to register the amounts it wants collected. Character 1 is the , and it is the only position all six bank layouts read for this page agree on. Everything a reader can count on begins at 109. That is the occurrence code saying what the bank is being asked to do, the company's own document number, the due date, and the amount at 127–139. The amount is thirteen digits whose last two are centavos with no decimal point written anywhere.

The blanks are the lesson. Characters 2 to 108 hold the bank's own identifiers for its customer — branch, account, agreement number, portfolio, its internal reference for the title. Every bank arranges them its own way, so this page publishes no layout for them and this sample leaves them empty. Every other blank is a position no field on this page declares. The person being billed occupies most of the tail: a registration type at 219–220, the registration number it explains at 221–234, and a name at 235–274 whose start is shared across the layouts and whose end is not.

SYNTHETIC / TRAINING ONLY. Illustrative, non-production example. Values are fictional and the message is not validated for any specific network, scheme, or implementation guide.

FULL CNAB400 Detalhe REFERENCE →

Sources for this sample — 3 sources
  1. Market practice

    kivanio/brcobranca — CNAB400 remessa and retorno layouts, one class per Brazilian bank ↗ — brcobranca contributors (open source) · lib/brcobranca/remessa/cnab400/ — the annotated character ranges the bank detail-record layouts share from position 109 to 400

    An open Ruby library that writes and reads Brazilian collection files. Its CNAB400 remittance directory carries twelve separate bank layout classes, most marking each field with its absolute character range, which is what lets the shared and the bank-specific parts of the 400-position detail record be measured rather than asserted. Its CNAB400 retorno directory carries the answer layouts. · Checked 2026-08-04

    Implementations, not the banks' own manuals, and their annotations contain arithmetic slips: the Banco do Brasil layout marks the payer address X[52] while writing 40 characters into the range it correctly declares as 275 to 314. The Banrisul layout gives two adjacent fields the same start position of 370; the Santander layout comments a percentage field as six characters where the method it calls defaults to four.

    Every position published from this source was checked against the absolute range the source declares and against the record adding up to 400.

    Files read at raw.githubusercontent.com/kivanio/brcobranca/master/... on the access date.

  2. Market practice

    andersondanilo/cnab_yaml — CNAB layouts as YAML, Sicoob CNAB400 remittance detail record ↗ — cnab_yaml contributors (open source) · cnab400/756/remessa/detalhe.yml — the declared start position, end position and picture clause of every field in the shared tail

    A machine-readable transcription giving an explicit start position, end position and picture clause for every field of the Sicoob (bank 756) CNAB400 remittance detail record. Used here as the independent check on the shared tail measured from the Ruby layouts, because its positions are declared rather than accumulated from field lengths. · Checked 2026-08-04

    A community transcription headed 'Baseado na documentação do SICOOB' — based on one bank's documentation, and therefore evidence for one bank's layout rather than for a CNAB400 standard. Cited for the positions it declares and for the two places where it subdivides an agreed range differently from the other layouts read: a one-character currency code at 193 inside the 193-205 block. And an interest, penalty and distribution split inside 161 to 173. Read at https://raw.githubusercontent.com/andersondanilo/cnab_yaml/master/cnab400/756/remessa/detalhe.yml on the access date.

  3. Simplified educational illustration

    Payments Signal editorial teaching models — Payments Signal

    This site's own simplified teaching models. · Checked 2026-07-12

    What this simplifies: Fictional payer, address, document number and amount, and one record rather than a file. A real remessa opens with a header and closes with a trailer, both also 400 characters. That is why the sequence number in the last six characters is 000002 rather than 000001. The three-digit bank code is 990, which is constructed — Brazil's Compe register assigns nothing in the 900s — so it names no real bank. The payer's registration number is 99000000000199, and its last two digits are not the check digits its first twelve compute to, so it cannot be a real CNPJ: the Cadastro Nacional da Pessoa Jurídica number that identifies a Brazilian company. The postcode is all zeros, which is not an allocated CEP, the Código de Endereçamento Postal, and the street address names no real street. Every character this page does not declare as a field is left blank, characters 2 to 108 included. Those belong to whichever bank the file is going to, and writing plausible values into them would be inventing one bank's layout and calling it CNAB400. A real file has them filled in, from the manual of the one bank you exchange files with. Not validated against any bank.

    Used wherever diagrams, scenarios, figures, or example values are didactic constructions rather than sourced facts; every such use carries a simplifications disclosure. All people, companies, banks, and list entries in examples are fictional.