Skip to main content
Skip to main content

Boleto Generator

Generate valid bank slips (Boletos) purposes. Perfect for software QA.

Waiting for generation...

About the Boleto Generator

A boleto (bank slip) is a standardized payment document used in Brazil that enables debt payment through banks, lottery outlets, and other authorized establishments. Each boleto contains essential information including the issuing bank, agency, cedent account number (issuer), amount, due date, payment instructions, and a unique barcode for automatic payment identification.

The Box4Dev Boleto Generator creates structurally valid boletos for testing and development purposes. Using the @box4dev/gerador-boleto library, this tool generates boleto numbers that follow the FEBRABAN standard (Brazilian Federation of Banks), complete with barcodes, typeable lines, and check digits calculated correctly according to each financial institution's official technical specifications.

This tool is designed exclusively for software development, system testing, prototyping, and form validation in sandbox environments. Use it to simulate payment flows, test input masks, validate payment gateway integrations, and ensure your system correctly handles boleto data - all without using real data or compromising security.

Legal Responsibility and Cautions: Boletos generated by this tool are fictitious and have no legal validity. Their issuance, distribution, or use for purposes other than testing and development is illegal and constitutes fraud. Using falsified boletos to attempt to receive payments, deceive third parties, or for any other dishonest purpose violates Brazilian law (Cybercrime Law) and can result in criminal prosecution, heavy fines, and imprisonment. You are responsible for how you use this tool. Use it only for legitimate development purposes.

Anatomy of Brazilian Bank Slip Typeful Line

The bank slip readable line comprises 47 decimal digits organized into 5 fields:

PositionFieldLengthMeaning & RuleExample
1 to 10Field 1 (Bank + Currency + CD1)10 digitsBank code (3), currency code (9 for BRL), 5 free digits and Modulo 10 check digit00190.00009
11 to 21Field 2 (Free Block + CD2)11 digitsPositions 6 to 15 of bank free block and Modulo 10 check digit01234.567802
22 to 32Field 3 (Free Block + CD3)11 digitsPositions 16 to 25 of bank free block and Modulo 10 check digit01234.567803
33Field 4 (Barcode Check Digit)1 digitGeneral barcode Modulo 11 check digit5
34 to 47Field 5 (Due Date + Value)14 digitsDue factor (4 digits) and face value in cents (10 digits)91230000015000

Bank Slip Algorithm (FEBRABAN Modulo 10)

Fields 1, 2 and 3 are validated by Modulo 10 with alternating weights 2 and 1:

CD = (NextTen - Sum(DigitReduction(d[i]*p[i]))) % 10
  1. 1. Multiply digits right to left alternately by 2 and 1.
  2. 2. If a product exceeds 9, sum its individual digits (e.g. 14 -> 1 + 4 = 5).
  3. 3. Compute overall sum of all results.
  4. 4. Subtract sum from the next multiple of 10.
  5. 5. If sum is a multiple of 10, check digit is 0.

Frequently Asked Questions

What exactly is a bank slip (boleto)?
A boleto is a standardized credit document used in Brazil for bill collection. It contains a barcode, typeable line, amount, due date, and cedent (issuer) information. It can be paid up to 90 days after the due date at banks, lottery outlets, and online platforms.
What is the Boleto Generator for?
It creates fictitious boletos for testing purposes. Use it to validate input masks, test typeable line processing, simulate payments in development environments, or train teams without using real data.
Are generated boletos valid and can they be paid?
No. Generated boletos are structurally valid (follow technical standards) but have no legal or financial validity. No Brazilian bank will accept payment of a boleto generated by this tool. They exist only as test data.
Can I use generated boletos to issue real charges?
Absolutely not. This is fraud and is a crime. Using falsified boletos to attempt to receive payments, deceive people, or commit fraud violates Brazilian law (Cybercrime Law - Law 12.737/12 and Fraud Law - Penal Code, Article 171). This can result in criminal prosecution, substantial fines, and imprisonment.
How do I validate if a generated boleto is correct?
A generated boleto is correct if: (1) the typeable line and barcode are continuous numbers without special characters (except in formatted form), (2) the check digit is calculated correctly, (3) dates are in correct format (always future for due date), and (4) the amount is a valid number. Use Box4Dev's Boleto Validator to confirm.
What is the difference between a real boleto and a generated one?
A real boleto is registered with the bank with a unique identifier, has a verified cedent (company), and can be legally paid. A generated boleto is only structural data, with no bank registration, no verified cedent, and cannot be paid. One is a legal document; the other is just a data structure.
Can I share or distribute generated boletos?
For educational or development documentation purposes, yes. But never send generated boletos to people with the intention of deceiving them or making them pay. Sharing falsified boletos with fraudulent intent is a crime of fraud and falsification.
Is this generator secure? Can I trust the data?
Yes, it is secure for legitimate testing use. Data is generated locally following official technical standards. There is no external server transmission. However, technical security does not mean you can use it for fraud - you remain legally responsible for your use.
What information do generated boletos contain?
Bank (selected or random), agency, account, our number, wallet, issue/due date, document value, cedent (company), document number, payment instructions, payment location, barcode, and typeable line - all generated randomly and without linking to real data.
Which bank should I use for testing?
Any bank from the list works for testing. Choose one your application needs to process. Barcode validation algorithms are the same for all. What differs is the bank code and specific agency/account rules for some banks - data you control in the generator.
Can I import these boletos into a real billing system?
It won't work. Real billing systems validate the boleto with the bank - a generated boleto does not exist in the bank and will be rejected. Additionally, injecting falsified boletos is a crime. Always use real data in production and generated boletos only in isolated testing environments.