Bank Account (Brazil) Generator and Validator

Generate and validate fictitious Brazilian bank account data (branch, operation and account with check digit) for software testing.

Notice: the generated data is fictitious and intended exclusively for software testing. It does not correspond to real accounts at any financial institution. The check digit (DV) follows the publicly documented modulo-11 rule of each bank, which may differ from each institution's internal/official variant — there is no official public test vector. See details in the FAQ.

Generate account

Validate account

Enter the bank, the branch (with DV) and the account (with DV). The tool recalculates the DV using the documented rule and tells you whether it matches. This does not verify that the account exists at any bank.

What are a bank branch and account?

The branch (agência) is the identification of the bank unit where the account was opened. In Brazil, it is represented by a 4-digit number, usually followed by a check digit (DV) — an extra number calculated from the preceding digits, which allows typing errors to be detected.

The checking or savings account is the number that identifies the customer's account within the branch. It also has a check digit, calculated in a similar way. Some banks add an operation (or product) code that classifies the type of account (e.g., checking account, savings account, student account).

What is the modulo-11 algorithm?

Modulo 11 is a checksum algorithm used by several Brazilian banks to calculate the check digit of branches and accounts. The algorithm walks through the digits from right to left, multiplying each one by an increasing weight (starting at 2). The sum of these products is divided by 11, and the remainder of the division determines the DV.

The calculation works as follows:

  1. Walk through the digits from right to left.
  2. Multiply each digit by an increasing weight, starting at 2 (2, 3, 4, …), cycling according to the bank's rule.
  3. Sum all the products.
  4. Calculate the remainder of the division by 11 (sum % 11).
  5. The DV is 11 minus the remainder. Special cases (remainder 0, resulting in DV 11, and remainder 1, resulting in DV 10) are handled specifically by each bank.

DV rules by bank (as implemented in this tool)

Each bank has its own variation of modulo 11. The rules below are the ones adopted in this tool, based on publicly available third-party documentation. They may differ from each institution's official internal rules (which are not publicly documented with official test vectors).

Frequently Asked Questions (FAQ)

Is the generated data from real accounts?

No. The branches, operations and accounts generated by this tool are completely fictitious. The numbers are generated randomly, and the DV is calculated using the documented rule for each bank. They are useful only for software testing, filling development forms and validating systems. Do not use this data in transactions, registrations or real documents.

Is the generated DV identical to what a real bank would calculate?

Not necessarily. The check digit follows each bank's publicly documented modulo-11 rule, based on third-party material. Each bank may have internal variations, exception tables or product-specific rules that are not publicly documented with official test vectors. This tool is suitable for software tests that implement this same public rule, but may not be compatible with every production banking system.

What is the "operation" at Caixa Econômica Federal?

Caixa uses a 3-digit code called "operation" (or "product") that identifies the type of account. For example: 001 for an individual checking account, 013 for an individual savings account, 023 for Caixa Fácil. This code is part of the account's DV calculation and must be entered correctly during validation.

Why can the DV be "X" or "P"?

In modulo 11, when the result of the calculation would be 10, some banks cannot represent that value with a single digit. Banco do Brasil adopts the letter X (similar to how it's used for other Brazilian documents) and Bradesco adopts the letter P in that situation. Other banks simply use 0 when the DV would be 10 or 11.

Can I use this data in bank homologation/sandbox systems?

It depends on the system. If the bank's homologation system validates the DV using the same public modulo-11 rule documented here, it probably will. But many banking systems perform additional checks (account existence, valid branch range, operation type), so the result may vary. This tool does not replace official sandbox environments provided by the banks.