Table of Contents
- What Is a NACHA File?
- NACHA File Structure Overview
- File Header Record (Record Type 1)
- Batch Header Record (Record Type 5)
- Entry Detail Record (Record Type 6)
- Batch Control Record (Record Type 8)
- File Control Record (Record Type 9)
- Complete NACHA File Example
- NACHA File Format in Excel
- Common NACHA File Errors
- Generate NACHA Files Automatically
1. What Is a NACHA File?
A NACHA file (sometimes called an ACH file) is a standardized flat-text file used to instruct banks to process electronic payments through the Automated Clearing House (ACH) network. NACHA stands for the National Automated Clearing House Association, the organization that defines and maintains the file format specification.
Every line in a NACHA file is exactly 94 characters long. The file uses a fixed-width format — meaning each field occupies a predefined number of character positions, padded with spaces or zeros as needed. Files typically carry the .ach extension and are uploaded to your bank's ACH portal to initiate payments or collections.
Because the format is strict and unforgiving, even a single character out of place will cause a bank to reject the file. That is why understanding the structure — and using reliable tooling — is essential.
2. NACHA File Structure Overview
A NACHA file is organized in a strict hierarchy. Think of it as a container (the file) holding one or more batches, each of which holds one or more payment entries:
- File Header (1) — Identifies the originating company and destination bank. One per file.
- Batch Header (5) — Groups related entries (e.g., all payroll payments). A file can contain multiple batches.
- Entry Detail (6) — A single payment or collection instruction to/from one account.
- Addenda (7) — Optional additional information attached to an entry (used in certain SEC codes like CTX).
- Batch Control (8) — Summary totals for the preceding batch: entry count, dollar totals, and entry hash.
- File Control (9) — Summary totals for the entire file. Followed by padding lines of all 9s to make the total line count a multiple of 10.
3. File Header Record (Record Type 1)
The File Header is always the first line in a NACHA file. It identifies who is sending the file and where it is going.
| Position | Length | Field Name | Example Value | Description |
|---|---|---|---|---|
| 1 | 1 | Record Type Code | 1 | Always "1" for File Header |
| 2-3 | 2 | Priority Code | 01 | Always "01" |
| 4-13 | 10 | Immediate Destination | 021000021 | Routing number of the receiving bank (space-prefixed) |
| 14-23 | 10 | Immediate Origin | 123456789 | Routing number or tax ID of the originator (space-prefixed) |
| 24-29 | 6 | File Creation Date | 260308 | YYMMDD format |
| 30-33 | 4 | File Creation Time | 1200 | HHMM format (optional but recommended) |
| 34 | 1 | File ID Modifier | A | A-Z, 0-9. Distinguishes files created on the same date |
| 35-37 | 3 | Record Size | 094 | Always "094" (94 characters per record) |
| 38-39 | 2 | Blocking Factor | 10 | Always "10" (10 records per block) |
| 40 | 1 | Format Code | 1 | Always "1" |
| 41-63 | 23 | Immediate Destination Name | RECEIVING BANK | Name of the destination bank |
| 64-86 | 23 | Immediate Origin Name | ACME CORPORATION | Name of the originating company |
| 87-94 | 8 | Reference Code | REF00001 | Optional reference for the originator |
4. Batch Header Record (Record Type 5)
Each batch groups related payment entries — for example, all payroll deposits or all vendor payments. A single NACHA file can contain multiple batches with different SEC codes or effective dates.
| Position | Length | Field Name | Example Value | Description |
|---|---|---|---|---|
| 1 | 1 | Record Type Code | 5 | Always "5" for Batch Header |
| 2-4 | 3 | Service Class Code | 200 | 200 = mixed debits/credits, 220 = credits only, 225 = debits only |
| 5-20 | 16 | Company Name | ACME CORPORATION | Name of the originating company |
| 21-40 | 20 | Company Discretionary Data | (spaces) | Optional — for company use |
| 41-50 | 10 | Company Identification | 1234567890 | Tax ID (EIN) prefixed with "1" or assigned ID |
| 51-53 | 3 | Standard Entry Class (SEC) Code | PPD | PPD, CCD, CTX, WEB, TEL, etc. |
| 54-63 | 10 | Company Entry Description | PAYROLL | Describes the purpose (shown on bank statements) |
| 64-69 | 6 | Company Descriptive Date | 260310 | Optional date for descriptive purposes |
| 70-75 | 6 | Effective Entry Date | 260308 | Date entries should be settled (YYMMDD) |
| 76-78 | 3 | Settlement Date | (spaces) | Left blank — filled in by the ACH Operator |
| 79 | 1 | Originator Status Code | 1 | Always "1" for originators |
| 80-87 | 8 | Originating DFI Identification | 02100001 | First 8 digits of the ODFI routing number |
| 88-94 | 7 | Batch Number | 0000001 | Sequential batch number within the file |
5. Entry Detail Record (Record Type 6)
Each Entry Detail record represents a single ACH transaction — a credit (deposit) or debit (withdrawal) to a specific bank account. This is where the actual payment amounts and recipient details live.
| Position | Length | Field Name | Example Value | Description |
|---|---|---|---|---|
| 1 | 1 | Record Type Code | 6 | Always "6" for Entry Detail |
| 2-3 | 2 | Transaction Code | 22 | 22 = checking credit, 27 = checking debit, 32 = savings credit, 37 = savings debit |
| 4-11 | 8 | RDFI Routing Number | 02100002 | First 8 digits of the receiving bank's routing number |
| 12 | 1 | Check Digit | 1 | 9th digit of the routing number (validation check) |
| 13-29 | 17 | DFI Account Number | 4000015873200000 | Recipient's bank account number (left-justified, space-padded) |
| 30-39 | 10 | Amount | 0000150000 | In cents — this equals $1,500.00 |
| 40-54 | 15 | Individual ID Number | (spaces) | Recipient's ID (employee number, account number, etc.) |
| 55-76 | 22 | Individual Name | JOHNSON JAMES R | Recipient's name |
| 77-78 | 2 | Discretionary Data | (spaces) | For originator use — usually blank |
| 79 | 1 | Addenda Record Indicator | 0 | 0 = no addenda, 1 = addenda follows |
| 80-94 | 15 | Trace Number | 021000010000001 | ODFI routing (8 digits) + sequential number. Must be unique per entry. |
0000150000.6. Batch Control Record (Record Type 8)
The Batch Control record closes a batch and contains summary totals used for validation. Banks compare these totals against the individual entries to detect transmission errors.
| Position | Length | Field Name | Example Value | Description |
|---|---|---|---|---|
| 1 | 1 | Record Type Code | 8 | Always "8" for Batch Control |
| 2-4 | 3 | Service Class Code | 200 | Must match the Batch Header |
| 5-10 | 6 | Entry/Addenda Count | 000003 | Total number of type 6 and type 7 records in this batch |
| 11-20 | 10 | Entry Hash | 0063000063 | Sum of all RDFI routing numbers (first 8 digits) in the batch |
| 21-32 | 12 | Total Debit Amount | 000000000000 | Sum of all debit amounts in cents |
| 33-44 | 12 | Total Credit Amount | 000004625000 | Sum of all credit amounts in cents ($46,250.00 total) |
| 45-54 | 10 | Company Identification | 1234567890 | Must match the Batch Header |
| 55-73 | 19 | Message Authentication Code | (spaces) | Reserved — leave blank |
| 74-79 | 6 | Reserved | (spaces) | Leave blank |
| 80-87 | 8 | Originating DFI Identification | 02100001 | Must match the Batch Header |
| 88-94 | 7 | Batch Number | 0000001 | Must match the Batch Header |
7. File Control Record (Record Type 9)
The File Control record is the final meaningful record in a NACHA file. It contains aggregate totals across all batches in the file, serving as a final integrity check.
| Position | Length | Field Name | Example Value | Description |
|---|---|---|---|---|
| 1 | 1 | Record Type Code | 9 | Always "9" for File Control |
| 2-7 | 6 | Batch Count | 000001 | Total number of batches in the file |
| 8-13 | 6 | Block Count | 000001 | Total number of 10-record blocks |
| 14-21 | 8 | Entry/Addenda Count | 00000003 | Total type 6 and type 7 records across all batches |
| 22-31 | 10 | Entry Hash | 0063000063 | Sum of all entry hash totals from all Batch Control records |
| 32-43 | 12 | Total Debit Amount | 000000000000 | Grand total of all debit amounts in cents |
| 44-55 | 12 | Total Credit Amount | 000004625000 | Grand total of all credit amounts in cents |
| 56-94 | 39 | Reserved | (spaces) | Leave blank |
After the File Control record, the file is padded with lines consisting entirely of the digit "9" (94 nines per line) until the total number of lines is a multiple of 10. This is called blocking — the blocking factor is always 10.
8. Complete NACHA File Example
Here is a complete, annotated NACHA file. This example contains one batch with three credit entries (a payroll run paying three employees), padded to a 10-line block:
9. NACHA File Format in Excel
Many businesses first encounter NACHA files when they try to build one in Excel or Google Sheets. While it is technically possible, the approach is fraught with challenges:
- Fixed-width formatting — Every field must be padded to an exact character length. Excel's default CSV export strips leading zeros and trailing spaces, breaking the format immediately.
- Numeric precision — Routing numbers and account numbers with leading zeros are treated as numbers by Excel, which silently drops the zeros (e.g., 021000021 becomes 21000021).
- Hash and total calculations — The Batch Control and File Control records require computed values (entry hash, total debits, total credits, entry counts) that must exactly match the individual entries. A single error means rejection.
- Blocking / padding — The total number of lines must be a multiple of 10, padded with 9-records. This is easy to forget.
- No validation — Excel cannot validate routing number check digits, verify SEC code rules, or enforce NACHA compliance rules.
10. Common NACHA File Errors
When banks reject a NACHA file, it is usually due to one of these issues:
1. Incorrect Record Length
Every record must be exactly 94 characters. Extra spaces, missing padding, or line-break issues (CRLF vs LF) are the most common culprits.
2. Invalid Entry Hash
The entry hash in the Batch Control record must equal the sum of all RDFI routing numbers (first 8 digits) from the Entry Detail records. If it does not match, the file is rejected.
3. Missing 9-Record Padding
The file must be padded with lines of all 9s so the total number of records is a multiple of 10. Missing padding causes block-count mismatches.
4. Routing Number Check Digit Failure
The 9th digit of a routing number is a check digit calculated from the first 8. An incorrect check digit makes the entire entry invalid.
5. Mismatched Batch and File Totals
The File Control record's totals must equal the sum of all Batch Control totals. Batch counts, entry counts, and dollar amounts must all reconcile.
6. Invalid or Missing Effective Entry Date
The effective entry date must be a valid business day within the bank's accepted window (typically 1-2 days in the future). Past dates or weekends/holidays are rejected.
Generate NACHA Files Automatically
Stop hand-coding ACH files or wrestling with Excel formulas. BatchPay QB connects to QuickBooks Online, pulls your bills and invoices, maps vendor banking details, and generates fully compliant NACHA files in seconds.
Frequently Asked Questions
What is a NACHA file format?
A NACHA file is a standardized flat-text file format used by banks and financial institutions to process ACH (Automated Clearing House) payments in batches. Each line is exactly 94 characters long, and the file follows a strict hierarchy of record types: File Header (1), Batch Header (5), Entry Detail (6), optional Addenda (7), Batch Control (8), and File Control (9).
How many characters are in each line of a NACHA file?
Every line (record) in a NACHA file must be exactly 94 characters long. This fixed-width format is critical — banks will reject files where any line deviates from this length.
Can I create a NACHA file from Excel?
While it is technically possible to build a NACHA file from Excel using formulas for padding and checksums, it is error-prone and not recommended for production use. Fixed-width formatting, hash totals, and entry counts must be calculated precisely. Tools like BatchPay QB automate the entire process and ensure compliance.
What are the most common NACHA file errors?
Common errors include incorrect record length (not 94 characters), invalid entry hash totals in the batch or file control records, missing 9-record padding to fill the final block of 10 lines, invalid routing number check digits, and mismatched batch counts between the file header and file control.
What is the difference between ACH and NACHA file formats?
ACH (Automated Clearing House) is the payment network, while NACHA (National Automated Clearing House Association) defines the file format specification used to submit payment instructions to that network. When people say "ACH file format" and "NACHA file format," they are referring to the same thing.
Related Articles
CCD vs PPD: ACH Entry Class Codes Explained
Understand when to use CCD for business payments vs PPD for consumer transactions.
How to Convert Excel to NACHA Format
Step-by-step guide to turning your spreadsheet data into bank-ready ACH files.
ACH SEC Codes: The Complete Guide
PPD, CCD, WEB, TEL, CTX — learn which SEC code applies to your payment type.