BAI2 File Format Explained: Record Codes, Type Codes, and an Example
Jul 20, 2026
Convert your bank statement to Excel now
PDF, JPG, PNG, BMP, HEIC, TIFF, MT940
Upload your bank statement
Drop file here or click to upload
PDF, JPG, PNG, BMP, HEIC, TIFF, MT940
Uploading...
Last updated July 2026.
A BAI2 file is a plain-text bank reporting file built from numbered records, where the first two digits of every line tell you what that line is. An 01 line opens the file, an 02 opens a group, an 03 identifies an account and its balances, each 16 is a single transaction, and the 49, 98, and 99 lines close the account, group, and file with control totals. Inside those records, a separate set of three-digit type codes says whether a number is an opening balance, a closing balance, a credit, or a debit. Once you know those two code systems, a BAI2 file reads cleanly and maps straight into spreadsheet columns.
BAI2 (short for the Bank Administration Institute Cash Management Balance Reporting Specification, Version 2) is how US banks deliver prior-day and intraday account information to corporate treasury and ERP systems. It is a reporting format, not a payment instruction: it tells you what happened on the account, so a controller can position cash and reconcile. If you are holding a .bai file and just need the rows in a sheet, the BAI to Excel converter parses the records and lays them out for you. This article explains what those records mean so the output makes sense.
What is a BAI2 file?
A BAI2 file is a structured text file a bank sends to report account balances and transactions for cash management. Each line is a record whose leading two-digit code identifies its role, and records nest inside each other: the file contains groups, groups contain accounts, and accounts contain transactions. It is comma-delimited within a record and closed by trailer records that carry running totals, which is how a treasury system verifies nothing was dropped in transit. Banks typically deliver one prior-day file per morning covering the previous business day, and some deliver intraday files during the day.
BAI2 record codes
Every record starts with a two-digit code. There are eight you need to recognize, and they always appear in the same nested order.
| Record code | Record name | What it does |
|---|---|---|
| 01 | File Header | Opens the file. Sender and receiver IDs, creation date and time, file ID. |
| 02 | Group Header | Opens a group of accounts, usually one bank and one as-of date. |
| 03 | Account Identifier | Names one account and carries its balance summary type codes. |
| 16 | Transaction Detail | One transaction: type code, amount, references, and text. |
| 88 | Continuation | Continues the previous record when it runs past the line length. |
| 49 | Account Trailer | Closes the account with a control total and record count. |
| 98 | Group Trailer | Closes the group with its own totals. |
| 99 | File Trailer | Closes the file with the total number of groups and records. |
The nesting is strict. A file is one or more groups, each group is one or more accounts, each account is zero or more transactions, and every level that opens must close with its matching trailer. When a converter or a validator complains, it is almost always because a trailer total does not match the records it is supposed to summarize.
BAI2 type codes
Type codes are the three-digit numbers that appear inside 03 and 16 records, and they carry the meaning. The ranges are the fastest way to read them: 010 through 099 are status and balance codes that live on the 03 account record, 100 through 399 are credits, 400 through 699 are debits, and 900 and up are custom or bank-defined. So the moment you see a 16 record with a type code that starts with a 4, you know it is money leaving the account.
| Type code | Meaning | Where it appears |
|---|---|---|
| 010 | Opening ledger balance | 03 record |
| 015 | Closing ledger balance | 03 record |
| 040 | Opening available balance | 03 record |
| 045 | Closing available balance | 03 record |
| 100 | Total credits (summary) | 03 record |
| 400 | Total debits (summary) | 03 record |
| 100 to 399 | Credit transactions (money in) | 16 records |
| 400 to 699 | Debit transactions (money out) | 16 records |
The full specification defines several hundred transaction type codes so that an incoming wire, a lockbox deposit, an ACH credit, a check paid, and a monthly service charge each get their own precise code. Banks do not all use the same subset, so treat the range (credit versus debit) as the reliable signal and the specific code as the detail you map to a category. The official list is in the BAI Cash Management Balance Reporting Specification.
What does an 03 account record contain?
The 03 record identifies one account and reports its balance summary. In order, its fields are the record code (03), the customer account number, the currency code, and then one or more repeating groups of type code, amount, item count, and funds type. That repeating structure is why a single 03 line can carry the opening ledger balance, the closing ledger balance, and the available balances all at once: each is a type code and amount pair. Funds type tells you when the money is available, for example same day or one-day float.
What does a 16 transaction record contain?
The 16 record is one transaction. Its fields are the record code (16), the type code, the amount, the funds type, the bank reference number, the customer reference number, and free-form text. The type code tells you what kind of transaction it is and, by its range, whether it is a credit or a debit. The two reference fields are what you use to tie a line back to a wire confirmation or an ACH batch, and the text field often carries the counterparty name or an invoice number your cash application process can match on.
A worked BAI2 example
Here is a minimal file for one account with two transactions, a $2,500.00 incoming credit and a $1,000.00 debit. Amounts in BAI2 are whole numbers with no decimal point, so $2,500.00 is written as 250000.
| Line | Reads as |
|---|---|
| 01,SENDERID,RECEIVERID,260720,0800,1,,,2/ | File header: sender, receiver, date, time, file ID. |
| 02,RECEIVERID,BANKID,1,260719,,USD,2/ | Group header: as-of July 19, currency USD. |
| 03,123456789,USD,010,500000,,,015,650000,,,/ | Account 123456789: opening ledger $5,000.00, closing ledger $6,500.00. |
| 16,165,250000,,WIRE0091,INV4471,ACME CORP/ | Credit $2,500.00, references, counterparty ACME CORP. |
| 16,475,100000,,CHK2210,,CHECK 2210/ | Debit $1,000.00, check number 2210. |
| 49,650000,5/ | Account trailer: control total and record count. |
| 98,650000,1,7/ | Group trailer. |
| 99,650000,1,9/ | File trailer. |
Mapped to a spreadsheet, that becomes two transaction rows with columns for date, type code, credit or debit, amount, reference, and description, plus the opening and closing balances pulled from the 03 record. That is exactly the shape a reconciliation or a cash-position sheet needs.
BAI2 versus other bank formats
BAI2 is the North American balance reporting standard, but it is one of a family, and which one you receive depends on the bank and the region. If you are deciding between them or received a file and are not sure what it is, the comparison in MT940 vs BAI2 vs camt.053 lays out the differences: MT940 is the SWIFT end-of-day statement used internationally, camt.053 is the newer ISO 20022 XML version banks are migrating toward, and BAI2 is the older flat-file US standard. Not every bank offers every format, and you often have to ask; the guide to getting a BAI2 or MT940 file from your bank covers how to request one.
Turning a BAI2 file into a spreadsheet
Most people who open a BAI2 file are not trying to read raw records; they need the transactions in Excel or CSV to reconcile, post to the ledger, or load into an ERP. The BAI to Excel converter parses the record and type codes described here and outputs one clean row per 16 transaction with the balances broken out, so you skip the manual decoding. Once the debit lines are laid out, coding them to the right expense accounts is the next job, and teams that also handle card spend and receipts often pair the bank data with automated expense capture so both sides of the ledger arrive already categorized. From there a standard bank reconciliation ties the closing balance from the 03 record to your books.
The short version
Read the two-digit record code to see structure and the three-digit type code to see meaning. Records nest file to group to account to transaction, each closed by a trailer whose totals must match. Type codes 010 to 099 are balances on the 03 record, 100 to 399 are credits, and 400 to 699 are debits. Get those rules straight and a BAI2 file stops looking like noise and starts looking like a bank statement with the labels moved to the front of each line.
Ready to convert your bank statement?
Upload a PDF and get clean Excel or CSV in seconds. Works with statements from any bank.
Convert to Excel nowFree to try, no credit card required