Money and Finance

How to Read a BAI2 File: Records, Type Codes and Control Totals

A guide to the BAI2 balance reporting format used by US banks, from the 01 header to the 99 trailer, with type codes, implied decimals and an example.

Saizul Amin
Saizul Amin7 Nov 2026 · 4 min read
How to Read a BAI2 File: Records, Type Codes and Control Totals

How to Read a BAI2 File: Records, Type Codes and Control Totals

If you work in treasury or cash management in the United States, there is a good chance your bank sends a BAI2 file every morning. It reports the previous day's balances and transactions for every account the company holds, and it is the input for cash positioning, bank reconciliation and lockbox matching in most ERP systems. It is also one of the least friendly file formats to read without help.

The record structure

BAI2 is a comma separated text file, but each line is a record whose meaning depends on its first two characters. Records nest like this:

  • 01 File header: sender, receiver, creation date and time, file ID and the version number 2.
  • 02 Group header: the originator, a status such as update or correction, the as-of date and the default currency.
  • 03 Account identifier: the account number, currency and any number of summary items, each a type code, amount, item count and funds type.
  • 16 Transaction detail: one transaction with its type code, amount, funds type, bank reference, customer reference and text.
  • 88 Continuation: more fields for the record before it.
  • 49 Account trailer, 98 Group trailer, 99 File trailer: control totals and counts.

Each record ends with a slash. Amounts have no decimal point: 1500000 in a USD file means 15,000.00.

Type codes

The three digit type code tells you what a number is. Codes from 001 to 099 are balances, such as 010 opening ledger, 015 closing ledger and 045 closing available. Codes 100 to 399 are credits and 400 to 699 are debits, so 165 is a preauthorized ACH credit, 195 an incoming money transfer, 451 an ACH debit received and 475 a check paid. Summary codes like 100 total credits and 400 total debits sit alongside the detail codes. The 900 range is reserved for each bank's own use and needs that bank's code list to interpret.

Worked example

Open the sample in the BAI2 bank statement file viewer. The header shows the file came from EXAMPLEBANK to CUSTOMER01, created at 23:00 on 31 October 2026, with one group and one USD account, 0012345678.

The 03 record reads 010,1500000 then 015,1612500 then 100,410000,2 and 400,297500,2. The viewer turns that into an opening ledger of 15,000.00, a closing ledger of 16,125.00, total credits of 4,100.00 over 2 items and total debits of 2,975.00 over 2 items.

Four 16 records follow. A 165 credit of 2,500.00 is a payroll refund. A 195 incoming wire of 1,600.00 from Acme Supply Co has its text carried onto an 88 record, which the viewer joins so the description reads in full. A 475 check paid of 475.00 is check 1042, and a 451 ACH debit of 2,500.00 is payroll funding. Starting at 15,000.00, the running balance moves to 17,500.00, 19,100.00, 18,625.00 and finally 16,125.00, matching the closing ledger.

The trailers agree too. The 49 record carries 4527500, which is the sum of all the raw amounts on the 03 and 16 lines, and counts 7 records for the account. The group trailer counts 9 records and the file trailer 11.

What the control totals tell you

Control totals in BAI2 add up the amounts as written, without signs, across the records they cover. They are a transmission check rather than a balance. If the 49 total does not match, a record has been lost, duplicated or edited. If the record count is off by one, a continuation line is often the cause. The viewer reports each mismatch with both figures, and it also compares the detail credits and debits with the 100 and 400 summary totals.

Common mistakes

Forgetting the implied decimals. Loading BAI2 into a spreadsheet as plain CSV gives balances a hundred times too large. Currencies such as JPY have no minor unit and are not divided.

Ignoring the funds type. A funds type of V adds a value date and time, and D adds a list of availability amounts. A parser that does not step over those fields puts references in the wrong columns.

Treating 88 records as new lines. They belong to the record above them and must be joined first.

Assuming 900 codes mean the same at every bank. They do not. Ask the bank for its list.

Reconciling to the summary instead of the detail. Summary totals can include items that never appear as details. Reconcile to the 16 records and use the summaries as a cross-check.

Exporting

The Excel download gives a Transactions sheet with signed amounts, debit and credit columns and the type meaning, plus a Statements sheet with balances. That is usually enough to reconcile one day's activity or to show a colleague what the bank sent.

Completely freeNo cost, no sign-up
Files stay privateEverything runs in your browser
Easy in your languageAvailable in many languages