Nacha file format: the six records and a sample

Reviewed by Keith Raphael, AAP, CAMS, APRP, Straddle Published Updated

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.

Contents

How 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.

Record types in a Nacha file, in the order they appear
Type code Record How many Main contents
1 File headerOne per fileRouting numbers of the file's destination and origin, creation date and time, file ID modifier
5 Batch headerOne per batchOriginator's name and Company Identification, SEC code, entry description, effective entry date
6 Entry detailOne or more per batchTransaction code, RDFI routing number, account number, amount, Receiver's name, trace number
7 AddendaNone, one or more per entry, depending on the SEC codePayment-related information, or return and correction details
8 Batch controlOne per batchCount of entry and addenda records, entry hash, debit and credit totals
9 File controlOne per fileBatch count, block count, entry and addenda count, entry hash, debit and credit totals
9 PaddingAs many as neededLines 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.

Contents

ACH 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.

Contents

File 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.

File header record fields (Nacha ACH developer guide)
Positions Length Field Contents
1 1Record Type CodeAlways 1
2-3 2Priority CodeAlways 01
4-13 10Immediate DestinationA blank, then the nine-digit routing number of the institution receiving the file, typically the Originator's bank
14-23 10Immediate OriginA 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 6File Creation DateYYMMDD
30-33 4File Creation TimeHHMM, 24-hour clock (optional)
34 1File ID ModifierA to Z or 0 to 9, unique for each file sent on the same processing day
35-37 3Record SizeAlways 094
38-39 2Blocking FactorAlways 10
40 1Format CodeAlways 1
41-63 23Immediate Destination NameName of the receiving institution (optional)
64-86 23Immediate Origin NameName of the sending institution (optional)
87-94 8Reference CodeFor 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.

Contents

Batch 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.

Batch header record fields, all SEC codes except IAT (Nacha ACH developer guide)
Positions Length Field Contents
1 1Record Type CodeAlways 5
2-4 3Service Class Code200, 220, or 225 (see below)
5-20 16Company NameName of the Originator that the Receiver knows and recognizes
21-40 20Company Discretionary DataCodes of meaning only to the Originator and ODFI (optional)
41-50 10Company IdentificationIdentifies the Originator; assigned by the ODFI
51-53 3Standard Entry Class CodeThree-character SEC code, such as PPD or CCD
54-63 10Company Entry DescriptionPurpose of the entries, shown to the Receiver; some SEC codes require specific values
64-69 6Company Descriptive DateA date the Originator wants shown to the Receiver
70-75 6Effective Entry DateYYMMDD, the banking day the Originator intends the batch to settle
76-78 3Settlement Date (Julian)Inserted by the ACH Operator
79 1Originator Status CodeCode that refers to the ODFI initiating the entry: 1 for a depository financial institution, 2 for a federal government entity or agency
80-87 8Originating DFI IdentificationFirst eight digits of the ODFI's routing number
88-94 7Batch NumberAssigned 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.

Contents

Entry 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 account
  • 23: prenote for a credit to a checking account
  • 27: debit from a checking account
  • 28: prenote for a debit from a checking account
  • 32: credit to a savings account
  • 33: prenote for a credit to a savings account
  • 37: debit from a savings account
  • 38: prenote for a debit from a savings account
  • 21, 26, 31, and 36: a return or notification of change for a checking credit, a checking debit, a savings credit, and a savings debit, in that order
  • 24, 29, 34, and 39: a zero-dollar entry with remittance data, for CCD, CTX, and IAT entries only (24 and 34 are also used for acknowledgment entries)

The layout below is the developer guide's layout for PPD and CCD entries.

Entry detail record fields for PPD and CCD entries (Nacha ACH developer guide)
Positions Length Field Contents
1 1Record Type CodeAlways 6
2-3 2Transaction CodeDebit or credit, and checking or savings (see below)
4-11 8Receiving DFI IdentificationFirst eight digits of the RDFI's routing number
12 1Check DigitNinth digit of the RDFI's routing number
13-29 17DFI Account NumberReceiver's account number
30-39 10Amount$$$$$$$$cc
40-54 15Identification NumberIdentifies the entry to the Receiver (optional)
55-76 22Receiving Individual/Company NameReceiver's name, which helps identify returned entries
77-78 2Discretionary DataCodes of meaning to the ODFI (optional)
79 1Addenda Record Indicator0 if no addenda record follows, 1 if one does
80-94 15Trace NumberAssigned 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.

Contents

Addenda 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 codes and their use
Addenda type code Used with Contents Limit
05 PPD, CCD, WEB, and CTX entriesUp to 80 characters of payment-related informationOne 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 dataOne per entry
99 ReturnsReturn reason code, original trace number, date of death for R14 and R15, original RDFI routing number, addenda informationOne per entry
10 to 16 IAT entriesSeven mandatory records with information about the partiesAll seven, in order
17 IAT entriesRemittance informationUp to two
18 IAT entriesForeign correspondent bank informationUp 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.

Contents

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.

Batch control record fields, all SEC codes except IAT (Nacha ACH developer guide)
Positions Length Field Contents
1 1Record Type CodeAlways 8
2-4 3Service Class CodeSame as the batch header
5-10 6Entry/Addenda CountNumber of entry detail and addenda records in the batch
11-20 10Entry HashSum of the Receiving DFI Identification fields of the batch's entry detail records
21-32 12Total Debit Entry Dollar AmountSum of the batch's debit entries
33-44 12Total Credit Entry Dollar AmountSum of the batch's credit entries
45-54 10Company IdentificationSame as the batch header
55-73 19Message Authentication CodeOptional authentication code
74-79 6ReservedBlank
80-87 8Originating DFI IdentificationSame as the batch header
88-94 7Batch NumberSame 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.

Contents

File 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.

File control record fields (Nacha ACH developer guide)
Positions Length Field Contents
1 1Record Type CodeAlways 9
2-7 6Batch CountNumber of batches in the file
8-13 6Block CountNumber of blocks of 10 lines in the file
14-21 8Entry/Addenda CountNumber of entry detail and addenda records in the file
22-31 10Entry HashSum of the Entry Hash fields of the file's batch control records
32-43 12Total Debit Entry Dollar Amount in FileSum of the file's debit entries
44-55 12Total Credit Entry Dollar Amount in FileSum of the file's credit entries
56-94 39ReservedBlank

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.

Contents

Nacha 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.

Sample Nacha file with one batch of two PPD debits (all routing numbers, account numbers, and names are fictitious)
101 012345672 9876543212612010930A094101ODFI BANK LENDER
5225LENDER 1234567890PPDLOAN PMT 261202 1012345670000001
62707654321612345678901 0000045000LOAN0001 BORROWER ONE 0012345670000001
62709876543855500011 0000032500LOAN0002 BORROWER TWO 1012345670000002
705PAYMENT 12 OF 36 LOAN 0002 00010000002
822500000300175308640000000775000000000000001234567890 012345670000001
9000001000001000000030017530864000000077500000000000000
9999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999
9999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999
9999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999

In 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.

Contents

What each line of the sample file contains

The table explains each line of the sample, from the file header to the padding.

What each line of the sample file contains
Line Record What it shows
1 File header101, destination 012345672, origin 987654321, created 261201 at 0930, file ID modifier A, 094, 10, 1, destination and origin names
2 Batch headerService 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 detailTransaction 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 detailTransaction code 27, RDFI 09876543 with check digit 8, amount 0000032500 ($325.00), addenda indicator 1, trace number 012345670000002
5 AddendaType 05, payment-related information, sequence 0001, entry detail sequence 0000002 (the last seven digits of line 4's trace number)
6 Batch controlService class 225, count 000003 (two entries and one addenda), entry hash 0017530864 (07654321 plus 09876543), debits 000000077500 ($775.00), credits zero
7 File controlOne batch, one block, 00000003 entry and addenda records, the same entry hash and totals
8 to 10 PaddingThree 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.

Contents

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.

PPD and CCD, CTX, and IAT records compared
Feature PPD and CCD CTX IAT
Batch header Standard layoutStandard layoutIAT layout: Foreign Exchange Indicator (positions 21-22), ISO Destination Country Code (39-40), Originator Identification (41-50)
Entry detail Standard layoutNumber 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 05Up to 9,999 05Seven 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,000Eligible for entries up to $1,000,000Not 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.

Contents

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.

  1. To collect money from a customer's bank account, use charges.
  2. To send money to a customer's bank account, use payouts.
  3. For request formats, environments, and authentication, read the Straddle API introduction.
Contents

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.

Contents

Sources

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

Start building for free with one command.

npx @straddlecom/wizard@latest

The Straddle Wizard plans, builds, and tests your integration with your coding agent, so you can focus on your product, not payments.

  • Build and test in the sandbox for free
  • Bring your own bank tokens for free
An example Wizard run: Found a Next.js app in src/, Plan written straddle-integration-plan.md, Sandbox tests passed straddle-test-evidence.md, then waiting for your approval to go live.