Free 30-minute AI & automation audit with a senior engineer. You keep the notes. Book yours

Software Development

NACHA File Format Explained: Records, Fields and a Sample ACH File

The NACHA file format explained record by record: file header, batches, entries, addenda, controls, blocking-factor padding, a sample ACH file and 2026 rules.

A NACHA file is a plain-text ACH payment file made of fixed-width, 94-character records. It starts with a file header (type 1), holds one or more batches (type 5 header, type 6 entries, optional type 7 addenda, type 8 control) and ends with a file control (type 9), padded with lines of 9s to a multiple of ten records.

This guide is for developers and finance systems teams who need to generate ACH files from an ERP, accounting system or Salesforce, or who have inherited a generator that keeps getting rejected. It walks through each record, the fields that matter most, how the padding works, a sample file with fake data and the checks that prevent common rejections.

Bank names are trademarks of their owners. MultiGenesys is not affiliated with these banks; always validate files against your bank’s current specification. This is engineering guidance, not legal or compliance advice.

How is a NACHA file structured?

Every record is exactly 94 characters, and the first character tells you its type. A file looks like this:

1  File header
5  Batch header        (one per batch)
6  Entry detail        (one per payment)
7  Addenda             (optional, follows its entry)
8  Batch control       (closes the batch)
9  File control
9999...                (padding to a multiple of 10 records)

A file can contain many batches. Each batch groups entries that share the same company, SEC code, entry description and effective entry date. Alphanumeric fields are left-justified and padded with spaces. Numeric fields are right-justified and padded with zeros. Amounts have no decimal point: $1,250.00 is written as 0000125000.

What is in the file header record (type 1)?

The file header identifies who sent the file and which bank receives it.

Positions Field Notes
1 Record type code Always 1
2–3 Priority code 01
4–13 Immediate destination Usually a space followed by the 9-digit routing number your bank gives you
14–23 Immediate origin 10 characters, value assigned by your bank
24–29 File creation date YYMMDD
30–33 File creation time HHMM
34 File ID modifier A to Z or 0 to 9; change it for each file sent on the same day
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 name
87–94 Reference code Optional

The immediate destination and immediate origin values are the fields people most often guess wrong. Do not derive them yourself. Your bank’s ACH origination specification tells you exactly what to put there.

What is in the batch header record (type 5)?

Positions Field Notes
1 Record type code 5
2–4 Service class code 200 mixed debits and credits, 220 credits only, 225 debits only
5–20 Company name Shown to the receiver in many cases
21–40 Company discretionary data Optional
41–50 Company identification Assigned or confirmed by your bank
51–53 Standard Entry Class (SEC) code For example PPD, CCD, CTX
54–63 Company entry description For example PAYROLL or VENDOR PAY
64–69 Company descriptive date Optional, free text
70–75 Effective entry date YYMMDD, the date you want the entries to settle
76–78 Settlement date Leave blank; the ACH operator fills it in
79 Originator status code 1
80–87 Originating DFI identification First 8 digits of your bank’s routing number
88–94 Batch number Ascending within the file

Which SEC code should you use?

The SEC code describes the type of payment and the authorization behind it:

  • PPD (Prearranged Payment and Deposit): payments to or from consumer accounts, such as payroll and recurring consumer debits.
  • CCD (Corporate Credit or Debit): payments between businesses, such as vendor payments, with room for one addenda record.
  • CTX (Corporate Trade Exchange): business payments that carry structured remittance data across many addenda records.

There are other SEC codes for web, telephone and check-conversion entries. If you are not sure which one applies, ask your bank before you build. Mixing SEC codes in one batch is not allowed; split them into separate batches.

What is in the entry detail record (type 6)?

Each payment is one entry detail record.

Positions Field Notes
1 Record type code 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 the routing number
13–29 DFI account number Receiver’s account, left-justified
30–39 Amount In cents, zero-filled
40–54 Individual identification number Your reference for the payee, such as an employee or vendor ID
55–76 Individual name Receiver’s name
77–78 Discretionary data Optional
79 Addenda record indicator 1 if an addenda follows, otherwise 0
80–94 Trace number 8-digit ODFI routing prefix plus a 7-digit sequence

Prenotes, which are zero-dollar test entries used to check an account before the first live payment, use their own transaction codes (for example 23 and 28 for checking). Check whether your bank or your process requires them.

What is in the addenda record (type 7)?

Positions Field Notes
1 Record type code 7
2–3 Addenda type code 05 for payment-related information on PPD, CCD and CTX
4–83 Payment related information 80 characters, such as invoice numbers or remittance data
84–87 Addenda sequence number Starts at 0001 for each entry
88–94 Entry detail sequence number Last 7 digits of the parent entry’s trace number

CCD allows one addenda per entry. CTX allows many, which is why it is used for structured remittance formats.

What is in the batch control record (type 8)?

Positions Field Notes
1 Record type code 8
2–4 Service class code Same as the batch header
5–10 Entry/addenda count Number of type 6 and type 7 records in the batch
11–20 Entry hash Sum of the 8-digit receiving DFI numbers, rightmost 10 digits
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

What is in the file control record (type 9)?

Positions Field Notes
1 Record type code 9
2–7 Batch count Number of batches
8–13 Block count Number of 10-record blocks, including padding
14–21 Entry/addenda count Total type 6 and type 7 records in the file
22–31 Entry hash Sum of all batch entry hashes, rightmost 10 digits
32–43 Total debit amount In cents
44–55 Total credit amount In cents
56–94 Reserved Blank

How does the blocking factor and padding work?

The blocking factor is 10. The total number of records in the file, including the file header and file control, must be a multiple of ten. If it is not, you add filler records made of 94 9 characters until it is.

The block count in the file control is the total record count divided by ten, after padding. A file with 6 real records needs 4 filler lines and has a block count of 1. A file with 23 real records needs 7 filler lines and has a block count of 3.

def pad_to_blocks(records):
    while len(records) % 10:
        records.append("9" * 94)
    return records

records = pad_to_blocks(records)
block_count = len(records) // 10

Some banks accept unpadded files, but padding to the standard is the safer default.

What does a sample NACHA file look like?

Here is a complete file with one CCD batch paying two vendors. Every value is fake: the routing numbers, account numbers, company ID and names are made up for illustration and must not be used for real payments. Trailing spaces are part of each 94-character line.

101 12345678012345678902611230900A094101EXAMPLE BANK           YOUR COMPANY INC               
5220YOUR COMPANY INC                    1234567890CCDVENDOR PAY      261124   1123456780000001
622234567898000123456789     0000125000V-1001         TEST VENDOR ONE         0123456780000001
622345678906987654321        0000048050V-1002         TEST VENDOR TWO         0123456780000002
822000000200580246790000000000000000001730501234567890                         123456780000001
9000001000001000000020058024679000000000000000000173050                                       
9999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999
9999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999
9999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999
9999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999

Reading it line by line:

  • The file header sends the file to an example bank, created on YYMMDD 261123 at 0900, with file ID modifier A.
  • The batch header uses service class 220 (credits only), SEC code CCD, entry description VENDOR PAY and effective date 261124.
  • Two entries with transaction code 22 (checking credit) pay $1,250.00 and $480.50.
  • The batch control shows 2 entries, an entry hash of 0058024679 (23456789 + 34567890) and total credits of $1,730.50.
  • The file control shows 1 batch, 1 block, 2 entries and the same hash and totals, followed by four padding lines.

Why do NACHA files get rejected or returned?

Two different things can go wrong. A rejection happens when your bank or the ACH operator refuses the file or a batch before it is processed. A return happens later, when the receiving bank sends an entry back.

Common causes of rejection:

  • A record that is not exactly 94 characters, often because of a trimmed trailing space or a Windows line ending added in the wrong place.
  • Control totals, entry counts or entry hashes that do not match the entries.
  • Wrong immediate origin, immediate destination or company identification values.
  • A duplicate file, often a resend with the same file ID modifier on the same day.
  • An effective entry date in the past, or a file sent after the bank’s cut-off.
  • Invalid routing numbers that fail the check-digit test.
  • Characters the bank does not accept in names or addenda.

Common causes of returns, each with its own return reason code, include insufficient funds, a closed account, an account that cannot be located, an invalid account number and a receiver saying the entry was not authorized. Your bank’s return file tells you which applies. Your system should read those returns, link them to the original payment and stop retrying an account that has been reported closed or invalid.

What changed with the 2026 Nacha fraud-monitoring rules?

Nacha introduced rules that require parties in the ACH network to have risk-based processes to identify entries initiated by fraud, such as payments made under false pretenses, including business email compromise and vendor impersonation. They came in two phases:

  • Phase 1, March 20, 2026: all ODFIs; non-consumer originators, third-party service providers and third-party senders with 6 million or more ACH originations in 2023; and RDFIs with 10 million or more ACH receipts in 2023, which must monitor incoming credits for fraud.
  • Phase 2, June 22, 2026 (nominally June 19, a federal holiday): all other non-consumer originators, third-party service providers and third-party senders, regardless of volume, and all other RDFIs.

See Nacha’s announcement of the new risk management rules for the scope that applies to you.

Also from March 20, 2026, the Company Entry Description must be PAYROLL for PPD wage credits and PURCHASE for consumer e-commerce purchase debits, so make the description a validated field, not free text. See Nacha’s rule on Company Entry Descriptions.

For engineering teams, the practical effect is that a payment file generator is no longer just a formatter. It sits on the path where fraud happens. Controls worth building into it:

  • Maker-checker approvals, so the person who builds a payment run cannot release it.
  • Beneficiary-change controls, with extra review when a vendor’s bank details changed shortly before a payment.
  • An audit trail that links each file to the approved payments, the approver and the bank’s acknowledgement.
  • Anomaly flags for first-time payees, unusual amounts or changed routing details.

These controls do not make you compliant on their own; your bank and your compliance team define what your monitoring has to cover. They do give you the records to show what you checked.

How do you generate NACHA files from an ERP or Salesforce?

Treat the generator as three separate layers:

  1. Payment model. Approved payments with payee, account, amount, SEC code and effective date, pulled from your ERP, accounting system or Salesforce.
  2. Formatter. Pure code that turns that model into records, with unit tests for padding, hashes, totals and every field width.
  3. Delivery and feedback. PGP encryption where the bank requires it, SFTP or portal upload, and a job that reads acknowledgements and returns back.

Large US banks such as Bank of America, JPMorgan Chase, Wells Fargo and Citi accept NACHA files through their treasury platforms or SFTP. Each issues its own specification, assigns your identifiers and runs a test cycle before live files are accepted. Plan for that cycle in your timeline.

From our projects

We built ABA (Australian Direct Entry) file generation for a Salesforce-native accounting product, mapping every ABA record and field to Salesforce bank-account and payment data, and we built bank-feed and document AI services for the same product family. ABA and NACHA share the same discipline: fixed-width records, control totals and a bank that rejects anything slightly off. Our ABA file format guide covers the Australian side.

That work led to FinAIQ Payment Files, the payment-file module of FinAIQ. FinAIQ Payment Files generates ABA, NACHA, ISO 20022 pain.001 and bank CSV files from Salesforce (as a managed package), ERPs, accounting systems or custom applications, and reads acknowledgements, pain.002 and BAI2, camt.053 and MT940 statements back. Runs have maker-checker approvals, PGP encryption, SFTP delivery and acknowledgement polling.

If you need ACH files from your ERP or Salesforce, see our NACHA ACH file generation service or FinAIQ Payment Files. For the statements that come back, see BAI2 file format explained; for every format we support, see bank payment files; and for US delivery, software development in the USA. If you want a second pair of eyes on your bank’s specification or a generator that keeps failing, Book a 30-min call.

FAQ

How long is each record in a NACHA file?

Every record is exactly 94 characters. Alphanumeric fields are padded with spaces on the right and numeric fields with zeros on the left.

What is the blocking factor in a NACHA file?

It is 10. The total record count must be a multiple of ten, so the file is padded with records of 94 9 characters, and the file control’s block count is the padded record count divided by ten.

How is the entry hash calculated?

Add the 8-digit receiving DFI identification (the first 8 digits of each receiver’s routing number) for every entry in the batch, and keep the rightmost 10 digits. The file entry hash is the sum of the batch hashes, again truncated to 10 digits.

What is the difference between PPD, CCD and CTX?

PPD is for payments to or from consumer accounts, such as payroll. CCD is for business-to-business payments with up to one addenda record. CTX is for business payments that carry structured remittance data in many addenda records.

Can I use the same NACHA file for any US bank?

The record layout is standard, but the values are not. Each bank assigns your immediate origin and company identification, may require specific file naming or encryption and has its own delivery channel and test process. Build to your bank’s specification and pass its test cycle first.

Newsletter

Get the MultiGenesys newsletter

Practical notes on AI, software engineering and automation from our engineers. One email a month, no spam, unsubscribe anytime.

By subscribing you agree to receive our newsletter. Unsubscribe anytime. See our privacy policy.

Free AI audit Book a call