Bank Branch Validator
Validate the format of a Brazilian bank branch number (4 digits, with an optional check digit). Useful for sign-ups, bank slips and checking banking data.
Bank branch number (agência): 4 digits, sometimes a check digit
In a Brazilian account, the agência is the branch number — typically 4 digits, sometimes followed by a check digit after a hyphen (1234-5). Together with the 3-digit bank code and the account number, it forms the banco + agência + conta triple that uniquely locates an account for boletos, TED/DOC and direct debit. This tool checks the NNNN / NNNN-D format.
There is no national check-digit standard for the agência: whether a verifying digit exists, and how it's computed, is defined by each bank. Some banks publish a digit; others use the four digits alone. That's why a portable validator checks structure, not a universal checksum.
The account triple
- Banco (3 digits, COMPE): which institution.
- Agência (4 digits + optional DV): which branch.
- Conta (varies + DV): the account itself.
- All three are needed to route a legacy transfer; PIX bypasses them with a key.
Where it matters
- Payment forms: agência is a required field for TED/DOC and boleto registration.
- Payroll & supplier payments: batch files (CNAB) carry agência per beneficiary.
- Reconciliation: matching deposits to the originating branch.
- Mock data / testing: validating the
NNNN-Dmask before a transfer.
Common pitfalls
- No universal check digit: don't apply one bank's DV rule to another's agência.
- Keep leading zeros:
0001is a real branch (often the head office); store as a string. - Hyphen optional:
1234-5and12345can mean the same; normalise carefully. - Agência changes, account may not: branch mergers can reassign the agência number.
FAQ
Does the agência have a check digit? Sometimes — it's bank-specific. Many branches are just four digits; others append a DV.
Do I still need the agência for PIX? No — PIX routes by key (CPF, email, phone or random). Agência is for legacy TED/DOC and boletos.
Is 0001 valid? Yes — leading-zero branch numbers are common; treat the value as a 4-character string.
Related Tools
Brazilian Bank Account Validator
Validate Brazilian bank account numbers by check digit for major banks (Bradesco, Itaú, Banco do Brasil, Santander and Caixa). Browser-side verification.
Receipt Number Validator
Validate common receipt number formats (REC-YYYY-NNNNN or REC.NNNNN). Accepts variations with dots and dashes. Validates year.
Country Bank Account Validator
Validate basic bank account format by country: BR (X-D), PT (21-digit NIB), US (9-digit routing), CA, UK.
Itaú Bank Account Validator
Validate Itaú checking account format and check digit: 4-digit branch + 5-digit account + 1 DV. Self-check algorithm.
IBAN Validator
Validate any international IBAN following ISO 13616 (mod-97) with country and length checks. Runs entirely in your browser — no data is sent anywhere.
Slug Validator
Check whether a slug is in valid format (a-z, 0-9, hyphens, no accents, no spaces, no double or edge hyphens). Suggests a fix. Everything in your browser.