Nacha file format: the six records and a sample
A Nacha file is a fixed-width ASCII text file of 94-character records: a file header, one or more batches of entries, and a file control record, padded with lines of 9s to a multiple of ten lines.
A Nacha file, also called an ACH file, is the text file of payment instructions that moves through the ACH Network. Nacha, the organization that writes the rules for the network, defines the layout in Appendix Three of the Nacha Operating Rules and summarizes it in its ACH developer guide. Every line is a record exactly 94 characters long, and every field sits at fixed positions in that line. The first character of a line identifies the record type.
A business that builds files for its bank, or reads the returns and notifications of change that come back, works with these positions directly. Control records repeat counts, dollar totals, and a hash total so the file can be checked, and the bank that receives the file may add its own formatting requirements to Nacha's.
What is a Nacha file?
A Nacha file is a set of ACH payment instructions, called entries, written in the fixed-width format that Nacha defines. The Originator, the business that starts an ACH payment, sends the file to its ODFI (originating depository financial institution), the bank that accepts its payment instructions. The ODFI combines batches from many Originators into larger files and sends them to an ACH Operator. There are two: the Federal Reserve Banks and The Clearing House's Electronic Payments Network. The ACH Operator sends each entry to the RDFI (receiving depository financial institution), the bank that posts it to the account of the Receiver.
The record layouts are the same at each step. A file from an Originator to its bank and a file from the bank to the ACH Operator use the same records, and Nacha's developer guide notes that an ODFI may set its own requirements for some fields, usually in the file header, so it can tell which client sent a file. A Third-Party Service Provider can also create ACH files on behalf of an Originator or an ODFI.
The full path of a payment, from Originator to settlement, is covered in how ACH payments work. Each entry detail record contains the Receiver's account number, and Nacha's rules require Originators and third parties above an annual volume threshold to make account numbers unreadable when they're stored electronically. Those requirements are covered in ACH data security.
ContentsHow a Nacha file is structured
A Nacha file starts with one file header record and ends with one file control record. Between them are one or more batches. Each batch starts with a batch header record, contains one or more entry detail records with any addenda records that belong to them, and ends with a batch control record. Nacha's developer guide compares this to braces or XML tags: every header that opens a section has a matching control record that closes it.
Each record type has a one-digit type code, which is always the first character of the line.
| Type code | Record | How many | Main contents |
|---|---|---|---|
| 1 | File header | One per file | Routing numbers of the file's destination and origin, creation date and time, file ID modifier |
| 5 | Batch header | One per batch | Originator's name and Company Identification, SEC code, entry description, effective entry date |
| 6 | Entry detail | One or more per batch | Transaction code, RDFI routing number, account number, amount, Receiver's name, trace number |
| 7 | Addenda | None, one or more per entry, depending on the SEC code | Payment-related information, or return and correction details |
| 8 | Batch control | One per batch | Count of entry and addenda records, entry hash, debit and credit totals |
| 9 | File control | One per file | Batch count, block count, entry and addenda count, entry hash, debit and credit totals |
| 9 | Padding | As many as needed | Lines of 9s that fill out the last block of 10 lines |
A batch groups entries that share the same batch-level data. Nacha's developer guide says entries go in the same batch when their SEC code, effective entry date, Company Identification, and batch description are identical. If any of these differ, such as a description of "BONUS" instead of "SALARY" or a different effective date, the entries go in separate batches. All entries in a batch are for one Originator.
A file can be balanced or unbalanced. A balanced file includes the offset (settlement) entry to the Originator's own account. An unbalanced file leaves it out, and the ODFI manages the offset.
ContentsACH file format rules: 94 characters, blocks, and padding
Every record in a Nacha file is exactly 94 characters long, and the file has a blocking factor of 10, so the number of lines must be a multiple of 10. When it isn't, the file is padded with lines made entirely of 9s. A file whose line count is already divisible by 10 needs no padding. The file header records both values: its Record Size field is always "094" and its Blocking Factor field is always "10".
The file is plain ASCII text, and Nacha's developer guide sets these rules for the fields inside each record:
- An alphanumeric field is left-justified and filled out to its length with spaces.
- A numeric field is unsigned, right-justified, and filled in from the left with zeros.
- Certain fields, such as those that contain codes, use uppercase characters only.
- Trace numbers, assigned by the ODFI, must be ascending within a batch, though not necessarily consecutive.
Amounts have no decimal point. The amount field of an entry detail record is 10 digits in the form $$$$$$$$cc, so $450.00 is written 0000045000. Dates are six digits in the form YYMMDD.
If a mandatory field doesn't meet Nacha's data specifications, the ACH Operator pends or rejects the file, the batch, or the entry. Appendix Three of the Nacha Operating Rules says the operator reports anything it pends or rejects to the ODFI or its sending point, and returns a rejected entry to the ODFI or its sending point.
ContentsFile header record (type 1)
The file header record is the first line of every Nacha file. It identifies the institution the file is going to and the one it comes from, and it contains the file's creation date and time, record size, and blocking factor. Every file header begins with 101: the record type code 1 followed by the priority code 01.
The developer guide gives one file header layout for all SEC codes.
| Positions | Length | Field | Contents |
|---|---|---|---|
| 1 | 1 | Record Type Code | Always 1 |
| 2-3 | 2 | Priority Code | Always 01 |
| 4-13 | 10 | Immediate Destination | A blank, then the nine-digit routing number of the institution receiving the file, typically the Originator's bank |
| 14-23 | 10 | Immediate Origin | A blank, then the nine-digit routing number of the institution sending the file; ODFIs often have the Originator put its company ID here |
| 24-29 | 6 | File Creation Date | YYMMDD |
| 30-33 | 4 | File Creation Time | HHMM, 24-hour clock (optional) |
| 34 | 1 | File ID Modifier | A to Z or 0 to 9, unique for each file sent on the same processing day |
| 35-37 | 3 | Record Size | Always 094 |
| 38-39 | 2 | Blocking Factor | Always 10 |
| 40 | 1 | Format Code | Always 1 |
| 41-63 | 23 | Immediate Destination Name | Name of the receiving institution (optional) |
| 64-86 | 23 | Immediate Origin Name | Name of the sending institution (optional) |
| 87-94 | 8 | Reference Code | For the business's own use (optional) |
Each file sent on the same processing day should have its own File ID Modifier, so that duplicate files can be identified.
ContentsBatch header record (type 5)
The batch header record opens each batch. It names the Originator and gives the batch's SEC code, the description the Receiver sees, and the effective entry date for every entry in the batch. The layout below applies to every SEC code except IAT, which has its own batch header.
| Positions | Length | Field | Contents |
|---|---|---|---|
| 1 | 1 | Record Type Code | Always 5 |
| 2-4 | 3 | Service Class Code | 200, 220, or 225 (see below) |
| 5-20 | 16 | Company Name | Name of the Originator that the Receiver knows and recognizes |
| 21-40 | 20 | Company Discretionary Data | Codes of meaning only to the Originator and ODFI (optional) |
| 41-50 | 10 | Company Identification | Identifies the Originator; assigned by the ODFI |
| 51-53 | 3 | Standard Entry Class Code | Three-character SEC code, such as PPD or CCD |
| 54-63 | 10 | Company Entry Description | Purpose of the entries, shown to the Receiver; some SEC codes require specific values |
| 64-69 | 6 | Company Descriptive Date | A date the Originator wants shown to the Receiver |
| 70-75 | 6 | Effective Entry Date | YYMMDD, the banking day the Originator intends the batch to settle |
| 76-78 | 3 | Settlement Date (Julian) | Inserted by the ACH Operator |
| 79 | 1 | Originator Status Code | Code that refers to the ODFI initiating the entry: 1 for a depository financial institution, 2 for a federal government entity or agency |
| 80-87 | 8 | Originating DFI Identification | First eight digits of the ODFI's routing number |
| 88-94 | 7 | Batch Number | Assigned in ascending order to each batch in the file |
A batch's service class code is 200 for a batch with both debits and credits, 220 for credits only, and 225 for debits only. The same code must appear in the batch header and the batch control record.
The SEC code (Standard Entry Class code) is a three-letter code for the type of payment, such as consumer or corporate and single or recurring, and the batch's entries and addenda use the record format for that code. Choosing one is covered in SEC codes. The company entry description and the Company Identification are both batch-level fields, so every entry in the batch shows the same description. The effective entry date must be a valid ACH processing date: ACH isn't processed on weekends or on certain federal holidays. The ACH Operator fills in the settlement date.
ContentsEntry detail record (type 6)
Each entry detail record is one payment: the account to debit or credit, the amount, the Receiver's name, and a trace number.
The transaction code is a two-digit code for whether the entry is a debit or a credit and for the type of account. The full list is in Appendix Three of the Nacha Operating Rules. Besides checking and savings accounts, it has codes for financial institution general ledger accounts (41 to 49) and loan accounts (51 to 56). A loan account takes credits, and takes debits only as reversals, under code 55. The common codes from Nacha's developer guide are below, followed by Appendix Three's return and zero-dollar codes for checking and savings accounts.
22: credit to a checking account23: prenote for a credit to a checking account27: debit from a checking account28: prenote for a debit from a checking account32: credit to a savings account33: prenote for a credit to a savings account37: debit from a savings account38: prenote for a debit from a savings account21,26,31, and36: a return or notification of change for a checking credit, a checking debit, a savings credit, and a savings debit, in that order24,29,34, and39: a zero-dollar entry with remittance data, for CCD, CTX, and IAT entries only (24and34are also used for acknowledgment entries)
The layout below is the developer guide's layout for PPD and CCD entries.
| Positions | Length | Field | Contents |
|---|---|---|---|
| 1 | 1 | Record Type Code | Always 6 |
| 2-3 | 2 | Transaction Code | Debit or credit, and checking or savings (see below) |
| 4-11 | 8 | Receiving DFI Identification | First eight digits of the RDFI's routing number |
| 12 | 1 | Check Digit | Ninth digit of the RDFI's routing number |
| 13-29 | 17 | DFI Account Number | Receiver's account number |
| 30-39 | 10 | Amount | $$$$$$$$cc |
| 40-54 | 15 | Identification Number | Identifies the entry to the Receiver (optional) |
| 55-76 | 22 | Receiving Individual/Company Name | Receiver's name, which helps identify returned entries |
| 77-78 | 2 | Discretionary Data | Codes of meaning to the ODFI (optional) |
| 79 | 1 | Addenda Record Indicator | 0 if no addenda record follows, 1 if one does |
| 80-94 | 15 | Trace Number | Assigned by the ODFI in ascending order; unique within the batch and the file |
A prenote (prenotification) is a non-monetary entry, so no money moves. Apart from the amount and transaction code, it should match the live entries that follow it, which lets the RDFI check the account details.
The trace number is 15 digits. The first eight are the ODFI's routing number, the same value as positions 80 to 87 of the batch header. The last seven are a unique number in ascending order. Returns and notifications of change quote the trace number of the original entry, which lets an Originator match them to the payment it sent.
WEB and TEL entries use the same positions with two differences. Positions 40 to 54 are the Individual Identification Number, which is required for person-to-person WEB credits, and positions 77 to 78 are a Payment Type Code field instead of Discretionary Data. A TEL entry can't have an addenda record, and a WEB entry can have one.
ContentsAddenda records (type 7)
An addenda record follows the entry detail record it belongs to and adds information to that entry. The addenda type code in positions 2 to 3 identifies which kind of addenda record it is.
| Addenda type code | Used with | Contents | Limit |
|---|---|---|---|
05 | PPD, CCD, WEB, and CTX entries | Up to 80 characters of payment-related information | One per PPD, CCD, or WEB entry; up to 9,999 per CTX entry |
98 | Notifications of change (COR entries) | Change code, original trace number, original RDFI routing number, corrected data | One per entry |
99 | Returns | Return reason code, original trace number, date of death for R14 and R15, original RDFI routing number, addenda information | One per entry |
10 to 16 | IAT entries | Seven mandatory records with information about the parties | All seven, in order |
17 | IAT entries | Remittance information | Up to two |
18 | IAT entries | Foreign correspondent bank information | Up to five, and no more than five 17 and 18 records combined |
In a 05 addenda, positions 4 to 83 hold the payment-related information, positions 84 to 87 hold the addenda sequence number, and positions 88 to 94 hold the entry detail sequence number, which is the last seven digits of the related entry's trace number. A PPD, CCD, or WEB entry can have only one addenda record, so its sequence number is always 0001. The RDFI may or may not show the payment-related information to the Receiver, depending on the bank and how the Receiver views the account.
A return comes back to the ODFI as an entry with a 99 addenda record. Positions 4 to 6 hold the return reason code, positions 7 to 21 the trace number of the original entry, and positions 28 to 35 the first eight digits of the original RDFI's routing number. Return reason codes and deadlines are covered in ACH returns.
A notification of change (NOC) is an entry an RDFI sends back to correct information, such as an account number, for future entries. It's sent as a COR entry with a 98 addenda record. Positions 4 to 6 hold the change code, such as C01 for an incorrect account number, positions 7 to 21 the original trace number, positions 28 to 35 the original RDFI's routing digits, and positions 36 to 64 the 29-character corrected data.
Batch control record (type 8)
The batch control record ends each batch. It repeats the batch's service class code, Company Identification, ODFI routing digits, and batch number from the batch header, and it adds the batch's record count, entry hash, and debit and credit totals. The layout below applies to every SEC code except IAT.
| Positions | Length | Field | Contents |
|---|---|---|---|
| 1 | 1 | Record Type Code | Always 8 |
| 2-4 | 3 | Service Class Code | Same as the batch header |
| 5-10 | 6 | Entry/Addenda Count | Number of entry detail and addenda records in the batch |
| 11-20 | 10 | Entry Hash | Sum of the Receiving DFI Identification fields of the batch's entry detail records |
| 21-32 | 12 | Total Debit Entry Dollar Amount | Sum of the batch's debit entries |
| 33-44 | 12 | Total Credit Entry Dollar Amount | Sum of the batch's credit entries |
| 45-54 | 10 | Company Identification | Same as the batch header |
| 55-73 | 19 | Message Authentication Code | Optional authentication code |
| 74-79 | 6 | Reserved | Blank |
| 80-87 | 8 | Originating DFI Identification | Same as the batch header |
| 88-94 | 7 | Batch Number | Same as the batch header |
The entry hash is a check total. It's the sum of the eight-digit Receiving DFI Identification field (positions 4 to 11, without the check digit) of every entry detail record in the batch. When the sum has more than 10 digits, the leftmost digits are dropped so that the 10 rightmost remain. Nacha's developer guide describes it as a checksum that ensures the validity of the batch.
The entry/addenda count includes both entry detail and addenda records, but not the batch header or batch control.
ContentsFile control record (type 9)
The file control record is the last record in the file before any padding. It has totals for the whole file: the number of batches, the number of 10-line blocks, the number of entry and addenda records, the entry hash, and the total debits and credits. The developer guide gives one file control layout for all SEC codes.
| Positions | Length | Field | Contents |
|---|---|---|---|
| 1 | 1 | Record Type Code | Always 9 |
| 2-7 | 6 | Batch Count | Number of batches in the file |
| 8-13 | 6 | Block Count | Number of blocks of 10 lines in the file |
| 14-21 | 8 | Entry/Addenda Count | Number of entry detail and addenda records in the file |
| 22-31 | 10 | Entry Hash | Sum of the Entry Hash fields of the file's batch control records |
| 32-43 | 12 | Total Debit Entry Dollar Amount in File | Sum of the file's debit entries |
| 44-55 | 12 | Total Credit Entry Dollar Amount in File | Sum of the file's credit entries |
| 56-94 | 39 | Reserved | Blank |
Both the file control and the padding lines start with 9. A padding line is 94 nines, while a file control record has counts and totals followed by 39 blanks.
ContentsNacha file format example
The sample below is a complete Nacha file with one batch: a lender collecting two loan repayments by PPD debit from borrowers' checking accounts, $450.00 from one borrower and $325.00 from another, with an addenda record on the second entry. The lender, routing numbers, account numbers, amounts, and dates are illustrative.
101 012345672 9876543212612010930A094101ODFI BANK LENDER5225LENDER 1234567890PPDLOAN PMT 261202 101234567000000162707654321612345678901 0000045000LOAN0001 BORROWER ONE 001234567000000162709876543855500011 0000032500LOAN0002 BORROWER TWO 1012345670000002705PAYMENT 12 OF 36 LOAN 0002 00010000002822500000300175308640000000775000000000000001234567890 0123456700000019000001000001000000030017530864000000077500000000000000999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999In the file itself, every line is exactly 94 characters. The spaces that pad the first and seventh lines to that length don't show here.
ContentsWhat each line of the sample file contains
The table explains each line of the sample, from the file header to the padding.
| Line | Record | What it shows |
|---|---|---|
| 1 | File header | 101, destination 012345672, origin 987654321, created 261201 at 0930, file ID modifier A, 094, 10, 1, destination and origin names |
| 2 | Batch header | Service class 225 (debits only), company name LENDER, Company Identification 1234567890, PPD, description LOAN PMT, effective entry date 261202, blank settlement date, status code 1, ODFI 01234567, batch 0000001 |
| 3 | Entry detail | Transaction code 27 (checking debit), RDFI 07654321 with check digit 6, amount 0000045000 ($450.00), name BORROWER ONE, addenda indicator 0, trace number 012345670000001 |
| 4 | Entry detail | Transaction code 27, RDFI 09876543 with check digit 8, amount 0000032500 ($325.00), addenda indicator 1, trace number 012345670000002 |
| 5 | Addenda | Type 05, payment-related information, sequence 0001, entry detail sequence 0000002 (the last seven digits of line 4's trace number) |
| 6 | Batch control | Service class 225, count 000003 (two entries and one addenda), entry hash 0017530864 (07654321 plus 09876543), debits 000000077500 ($775.00), credits zero |
| 7 | File control | One batch, one block, 00000003 entry and addenda records, the same entry hash and totals |
| 8 to 10 | Padding | Three lines of 9s bring the file from 7 lines to 10 |
The file is unbalanced: it has no offsetting credit to the lender's own account, and the ODFI manages that offset. If one borrower's account were closed, the lender would later receive a return entry with a 99 addenda record that quotes 012345670000001 or 012345670000002 as the original trace number.
How CTX and IAT files differ
CTX and IAT entries use the same file header, file control, and padding rules as other entries, but their entry detail records, and for IAT the batch header, have different layouts. Both also allow far more addenda records than PPD or CCD.
A CTX (Corporate Trade Exchange) entry is a credit or debit to a business account that can have up to 9,999 addenda records. Each 05 addenda holds 80 characters of payment-related information, which must be ANSI ASC X12 data segments, Nacha banking conventions, or XML, so trading partners can send full remittance detail with one payment. The CTX entry detail record replaces the PPD and CCD name field with a Number of Addenda Records field in positions 55 to 58 and a 16-character Receiving Company Name in positions 59 to 74.
An IAT (International ACH Transaction) entry is the US ACH part of an international payment transaction. Since September 18, 2026, that's a transaction that starts with, passes through, or reaches an account at a financial agency outside the US, or uses such an agency's facility to receive from a sender or deliver to a receiver. Its batch header has foreign exchange fields, an ISO destination country code, and an Originator Identification field. Each IAT entry has seven mandatory addenda records and up to five optional ones, 12 in total.
| Feature | PPD and CCD | CTX | IAT |
|---|---|---|---|
| Batch header | Standard layout | Standard layout | IAT layout: Foreign Exchange Indicator (positions 21-22), ISO Destination Country Code (39-40), Originator Identification (41-50) |
| Entry detail | Standard layout | Number of Addenda Records (55-58), Receiving Company Name (59-74) | IAT layout, with Number of Addenda Records in positions 13-16 |
| Addenda records | Up to one 05 | Up to 9,999 05 | Seven mandatory (10 to 16), up to two 17 and up to five 18, 12 at most |
| Same Day ACH | Eligible for entries up to $1,000,000 | Eligible for entries up to $1,000,000 | Not eligible |
The ACH Operator rejects an IAT entry that is missing a mandatory addenda record, has addenda types 10 to 16 out of order, or has more than 12 addenda records. IAT entries also can't be sent as Same Day ACH.
How Straddle creates ACH payments
Straddle's API moves money between a platform and its customers' bank accounts. A business creates a charge to collect money from a customer's bank account and a payout to send money to one. Requests and responses are JSON, and the API works on one object per request: bulk updates aren't supported.
Straddle selects the payment rail for each payment, and ACH is one of the rails it uses, so a business doesn't need to specify the rail. A sandbox environment lets a business test payments without affecting live data or reaching real banking networks.
- To collect money from a customer's bank account, use charges.
- To send money to a customer's bank account, use payouts.
- For request formats, environments, and authentication, read the Straddle API introduction.
Questions
Is a Nacha file the same as an ACH file?
Yes. Nacha's developer guide calls it an ACH file, and "Nacha file" refers to the same format by the name of the organization that defines it. Both terms mean a fixed-width text file of 94-character records in the layout set out in Appendix Three of the Nacha Operating Rules.
Why does a Nacha file end with lines of 9s?
The file's blocking factor is 10, so its line count must be a multiple of 10. When the real records don't reach a multiple of 10, lines of 94 nines fill the gap. A file whose record count is already a multiple of 10 has no padding lines.
How is the entry hash in a Nacha file calculated?
Add the first eight digits of the RDFI routing number from every entry detail record in a batch, leaving out the check digit. If the result has more than 10 digits, keep the rightmost 10. The file control record's entry hash is the sum of all the batch entry hashes, truncated the same way.
Can one batch contain both debits and credits?
Yes. A batch with service class code 200 can contain both debits and credits, while 220 is for credits only and 225 for debits only. Each batch also needs the same SEC code, effective entry date, Company Identification, and description for all its entries.
Where does a return reason code appear in a Nacha file?
It appears in the return entry's addenda record, which has addenda type code 99. The return reason code is in positions 4 to 6, followed by the trace number of the original entry in positions 7 to 21, so the Originator can match the return to its payment.
Who assigns the trace number on an ACH entry?
Nacha's developer guide says the ODFI assigns it. The trace number is 15 digits: the ODFI's eight-digit routing number followed by a seven-digit number that is unique and ascending within the batch.
Sources
- Nacha: ACH Developer Guide, ACH File Overview
- Nacha: ACH Developer Guide, ACH File Details
- Nacha: 2026 Nacha Operating Rules, Appendix Three
- Nacha: ACH Developer Guide, How ACH Works
- Nacha: Supplementing Data Security Requirements
- Nacha: ISO 20022 Credit Transaction Guide to Mapping U.S. ACH File Formats, CCD, CTX, PPD and Outbound IAT (version 4.01, August 2023)
- Nacha: ISO 20022 Guide to Mapping U.S. ACH Return Items and Notifications of Change (version 2.01, August 2023)
- Nacha: International ACH Transactions (IAT) Frequently Asked Questions (updated March 9, 2021)
- Bureau of the Fiscal Service: Green Book, A Guide to Federal Government ACH Payments
- Straddle: Payments overview
- Straddle: API introduction
This guide explains how the rules work. It isn't legal advice, and it doesn't replace the rules themselves or advice about your own obligations.
Contents