NACHA file format
A NACHA file, or ACH file, is plain text with one record per line. Every record is 94 characters long, and its first character says which record it is.
An example file, line by line
This is our sample nacha-sample-valid.ach: a payroll batch and a vendor batch. The routing numbers are invented; they start with 99.
101·990000026·9900000132610090830A094101SAMPLE·DESTINATION·BANKSAMPLE·COMPANY·················
5220SAMPLE·COMPANY··NOT·A·REAL·PAYMENT··1990000001PPDPAYROLL···OCT·09261013···1990000010000001
622990000110000111222333·····0000185000EMP0001········SAMPLE·EMPLOYEE·ONE·····0990000010000001
62299000012344455566·········0000212550EMP0002········SAMPLE·EMPLOYEE·TWO·····0990000010000002
6329900001367778889990·······0000097025EMP0003········SAMPLE·EMPLOYEE·THREE···0990000010000003
822000000302970000360000000000000000004945751990000001·························990000010000001
5200SAMPLE·COMPANY··NOT·A·REAL·PAYMENT··1990000001CCDVENDOR·PAYOCT·09261013···1990000010000002
6229900002175550001··········0001250000VENDOR-17······SAMPLE·SUPPLIER·LLC·····1990000010000004
705RMR*IV*INV-2041**12500.00\······················································00010000004
6279900002205550002··········0000048000CUST-88········SAMPLE·CUSTOMER·INC·····0990000010000005
820000000301980000430000000480000000012500001990000001·························990000010000002
9000002000002000000060495000079000000048000000001744575·······································
9999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999
9999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999
9999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999
9999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999
9999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999
9999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999
9999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999
9999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999Spaces are shown as dots so that they can be counted; the download holds the file as it is.
| Line | Type | Record |
|---|---|---|
| 1 | 1 | File Header |
| 2 | 5 | Batch Header |
| 3 | 6 | Entry Detail |
| 4 | 6 | Entry Detail |
| 5 | 6 | Entry Detail |
| 6 | 8 | Batch Control |
| 7 | 5 | Batch Header |
| 8 | 6 | Entry Detail |
| 9 | 7 | Addenda |
| 10 | 6 | Entry Detail |
| 11 | 8 | Batch Control |
| 12 | 9 | File Control |
| 13-20 | 9 | Padding: a line of 9s |
The order of the records
- One File Header (1).
- For each batch: a Batch Header (5), its Entry Detail records (6), each followed by its Addenda records (7) if it has any, and a Batch Control (8).
- One File Control (9).
- Lines of 9s until the number of lines is a multiple of 10. The File Header says so: blocking factor 10.
Field positions
Positions count from 1. Numbers are right-justified and zero-filled; text is left-justified and space-filled.
Type 1: File Header
| Positions | Field | Content |
|---|---|---|
| 1 | Record type | 1 |
| 2-3 | Priority code | 01 |
| 4-13 | Immediate destination | A blank, then your bank's 9-digit routing number |
| 14-23 | Immediate origin | A blank, then a 9-digit routing number, or what your bank tells you to put here |
| 24-29 | File creation date | YYMMDD |
| 30-33 | File creation time | HHMM, or blank |
| 34 | File ID modifier | A-Z or 0-9 |
| 35-37 | Record size | 094 |
| 38-39 | Blocking factor | 10 |
| 40 | Format code | 1 |
| 41-63 | Immediate destination name | Your bank's name |
| 64-86 | Immediate origin name | Your company's name |
| 87-94 | Reference code | Optional |
Type 5: Batch Header
| Positions | Field | Content |
|---|---|---|
| 1 | Record type | 5 |
| 2-4 | Service class code | 200 mixed, 220 credits only, 225 debits only |
| 5-20 | Company name | As the receiver will see it |
| 21-40 | Company discretionary data | Optional |
| 41-50 | Company identification | The ID your bank assigned your company |
| 51-53 | Standard entry class code | PPD, CCD, WEB, TEL, CTX, ... |
| 54-63 | Company entry description | For example PAYROLL |
| 64-69 | Company descriptive date | Optional, as text |
| 70-75 | Effective entry date | YYMMDD, the day you want the entries to settle |
| 76-78 | Settlement date | Blank; filled in by the ACH operator |
| 79 | Originator status code | 1 (0 and 2 exist) |
| 80-87 | Originating DFI identification | First 8 digits of your bank's routing number |
| 88-94 | Batch number | Ascending within the file |
Type 6: Entry Detail
| Positions | Field | Content |
|---|---|---|
| 1 | Record type | 6 |
| 2-3 | Transaction code | 22 checking credit, 27 checking debit, 32 savings credit, 37 savings debit |
| 4-11 | Receiving DFI identification | First 8 digits of the receiver's routing number |
| 12 | Check digit | Ninth digit of that routing number |
| 13-29 | DFI account number | Left-justified, space-filled |
| 30-39 | Amount | In cents, zero-filled, no decimal point |
| 40-54 | Identification number | Your reference for the receiver |
| 55-76 | Individual name | Receiver's name |
| 77-78 | Discretionary data | Optional; for WEB and TEL the payment type code |
| 79 | Addenda record indicator | 1 if an addenda record follows, otherwise 0 |
| 80-94 | Trace number | First 8 digits of your bank's routing number and a 7-digit sequence |
Type 7: Addenda
| Positions | Field | Content |
|---|---|---|
| 1 | Record type | 7 |
| 2-3 | Addenda type code | 05 for remittance information |
| 4-83 | Payment related information | Free text, for example an invoice number |
| 84-87 | Addenda sequence number | 0001 for the first addenda of an entry |
| 88-94 | Entry detail sequence number | Last 7 digits of the entry's trace number |
Type 8: Batch Control
| Positions | Field | Content |
|---|---|---|
| 1 | Record type | 8 |
| 2-4 | Service class code | Same as the batch header |
| 5-10 | Entry/addenda count | Entries plus addenda records in the batch |
| 11-20 | Entry hash | See below |
| 21-32 | Total debit amount | In cents |
| 33-44 | Total credit amount | In cents |
| 45-54 | Company identification | Same as the batch header |
| 55-73 | Message authentication code | Usually blank |
| 74-79 | Reserved | Blank |
| 80-87 | Originating DFI identification | Same as the batch header |
| 88-94 | Batch number | Same as the batch header |
Type 9: File Control
| Positions | Field | Content |
|---|---|---|
| 1 | Record type | 9 |
| 2-7 | Batch count | Number of batches |
| 8-13 | Block count | Records in the file divided by 10, rounded up |
| 14-21 | Entry/addenda count | All entries and addenda records |
| 22-31 | Entry hash | Sum of the batches' entry hashes, last 10 digits |
| 32-43 | Total debit amount | In cents |
| 44-55 | Total credit amount | In cents |
| 56-94 | Reserved | Blank |
CTX and IAT entries move some of the type 6 fields.
Totals and the entry hash
Each Batch Control repeats what its batch holds: the number of entries and addenda, the debit and credit totals in cents, and the entry hash. The entry hash is the sum of the 8-digit receiving DFI numbers (positions 4-11) of the batch's entries, keeping the last 10 digits.
In the sample's first batch: 99000011 + 99000012 + 99000013 = 297000036. The Batch Control on line 6 has 0297000036 in positions 11-20.
The File Control adds up the batches, and its block count is the number of lines divided by 10. When one of these does not match, see the entry hash does not match and the block count does not match.
Check a file
The NACHA file validator checks the record lengths, order, counts, entry hash and totals of your own file and names the line and positions of each problem. To see the entries as a table, use NACHA file to Excel. Both only read the file.
Layouts from Nacha's ACH developer guide. Your bank may have rules of its own.