Reference

The ACH file format, field by field

Every record in a NACHA file, the exact character positions of every field, and the codes that go in them, with a worked example you can open in the viewer.

File structure

An ACH file (also called a NACHA file) is a plain ASCII text file made of fixed-width records. Every record is exactly 94 characters, and the first character is the record type code. Records always appear in this order:

  1. 1File Headeronce, first line
  2. 5Batch Headerstarts each batch
  3. 6Entry Detailone per payment
  4. 7Addendaoptional, after its entry
  5. 8Batch Controlcloses each batch
  6. 9File Controlonce
  7. 9…Filler (all 9s)to a multiple of 10 lines

Alphanumeric fields are left-justified and padded with spaces; numeric fields are right-justified and padded with zeros. Amounts have no decimal point: 0000125000 is $1,250.00. Dates are YYMMDD. Most banks expect uppercase letters.

File Header Record (type 1)

The first line of the file. It says who is sending the file and which bank it's going to.

File Header layout
PositionFieldLengthTypeWhat goes here
1Record Type Code1NumericAlways 1
2–3Priority Code2NumericAlways 01
4–13Immediate Destination10AlphanumericYour bank's routing number, preceded by a space
14–23Immediate Origin10AlphanumericYour company ID or routing number, as your bank assigns it
24–29File Creation Date6Date (YYMMDD)YYMMDD
30–33File Creation Time4Time (HHMM)HHMM, 24-hour
34File ID Modifier1AlphanumericA-Z or 0-9; change it for each file sent the same day
35–37Record Size3NumericAlways 094
38–39Blocking Factor2NumericAlways 10
40Format Code1NumericAlways 1
41–63Immediate Destination Name23AlphanumericYour bank's name
64–86Immediate Origin Name23AlphanumericYour company name
87–94Reference Code8AlphanumericOptional, for your own use

Batch Header Record (type 5)

Starts a batch of entries that share a company, a payment type (SEC code), a description and an effective date. A file can hold many batches.

Batch Header layout
PositionFieldLengthTypeWhat goes here
1Record Type Code1NumericAlways 5
2–4Service Class Code3Numeric200 mixed, 220 credits only, 225 debits only
5–20Company Name16AlphanumericName the receiver will recognize
21–40Company Discretionary Data20AlphanumericOptional
41–50Company Identification10AlphanumericUsually 1 + your EIN, or as your bank assigns
51–53Standard Entry Class Code3AlphanumericPPD, CCD, WEB, TEL, CTX…
54–63Company Entry Description10AlphanumericShown to the receiver, e.g. PAYROLL
64–69Company Descriptive Date6AlphanumericOptional, e.g. MAR 26
70–75Effective Entry Date6Date (YYMMDD)YYMMDD, the date you want it to settle
76–78Settlement Date3BlankJulian date; left blank, the ACH Operator fills it
79Originator Status Code1AlphanumericUsually 1
80–87Originating DFI Identification8Numeric (routing)First 8 digits of your bank's routing number
88–94Batch Number7NumericNumbered 1, 2, 3… in the file

Service class codes: 200 mixed debits and credits, 220 credits only, 225 debits only.

Entry Detail Record (type 6)

One payment: who receives it, their bank and account, the amount and a unique trace number. This is the PPD, WEB and TEL layout; CCD uses the same positions but calls positions 40–54 the Identification Number and 55–76 the Receiving Company Name.

Entry Detail layout
PositionFieldLengthTypeWhat goes here
1Record Type Code1NumericAlways 6
2–3Transaction Code2Numerice.g. 22 checking credit, 27 checking debit
4–11Receiving DFI Identification8Numeric (routing)First 8 digits of the receiver's routing number
12Check Digit1Numeric9th digit of the routing number
13–29DFI Account Number17AlphanumericReceiver's account number, left-justified
30–39Amount10Amount (cents)In cents, no decimal point
40–54Individual Identification Number15AlphanumericOptional ID, e.g. employee number
55–76Individual Name22AlphanumericReceiver's name
77–78Discretionary Data2AlphanumericOptional; payment type code for WEB/TEL
79Addenda Record Indicator1Numeric1 if an addenda record follows, else 0
80–94Trace Number15NumericODFI routing (8) + sequence number (7)

CTX entry detail

Corporate trade exchange entries carry a count of addenda records and a shorter company name.

CTX Entry Detail layout
PositionFieldLengthTypeWhat goes here
1Record Type Code1NumericAlways 6
2–3Transaction Code2Numeric
4–11Receiving DFI Identification8Numeric (routing)
12Check Digit1Numeric
13–29DFI Account Number17Alphanumeric
30–39Total Amount10Amount (cents)In cents
40–54Identification Number15Alphanumeric
55–58Number of Addenda Records4Numeric
59–74Receiving Company Name16Alphanumeric
75–76Reserved2Blank
77–78Discretionary Data2Alphanumeric
79Addenda Record Indicator1Numeric
80–94Trace Number15Numeric

Addenda Record (type 7)

Extra information attached to the entry directly above it. PPD, CCD and WEB entries allow one addenda (type code 05) with 80 characters of payment information, such as an invoice number. The entry's Addenda Record Indicator must be 1.

Addenda layout
PositionFieldLengthTypeWhat goes here
1Record Type Code1NumericAlways 7
2–3Addenda Type Code2Numeric05 for PPD/CCD/WEB remittance info
4–83Payment Related Information80AlphanumericFree-form remittance details
84–87Addenda Sequence Number4Numeric1 for the first addenda of an entry
88–94Entry Detail Sequence Number7NumericLast 7 digits of the entry's trace number

Return addenda (type 99)

When a payment is returned, the bank sends back an entry with this addenda. The return reason code says why.

Return addenda layout
PositionFieldLengthTypeWhat goes here
1Record Type Code1NumericAlways 7
2–3Addenda Type Code2Numeric99 = return
4–6Return Reason Code3Alphanumerice.g. R01 insufficient funds
7–21Original Entry Trace Number15NumericTrace number of the entry you sent
22–27Date of Death6AlphanumericOnly for R14/R15
28–35Original Receiving DFI Identification8Alphanumeric
36–79Addenda Information44Alphanumeric
80–94Trace Number15NumericSame as the return entry's trace number

Notification of change addenda (type 98)

A notification of change (NOC) tells you to correct details, like an account number, before your next payment.

NOC addenda layout
PositionFieldLengthTypeWhat goes here
1Record Type Code1NumericAlways 7
2–3Addenda Type Code2Numeric98 = notification of change
4–6Change Code3Alphanumerice.g. C01 incorrect account number
7–21Original Entry Trace Number15NumericTrace number of the entry you sent
22–27Reserved6Blank
28–35Original Receiving DFI Identification8Alphanumeric
36–64Corrected Data29AlphanumericWhat to change it to
65–79Reserved15Blank
80–94Trace Number15NumericSame as the NOC entry's trace number

Batch Control Record (type 8)

Closes the batch and repeats its totals so the bank can confirm nothing was added, lost or changed.

Batch Control layout
PositionFieldLengthTypeWhat goes here
1Record Type Code1NumericAlways 8
2–4Service Class Code3NumericSame as the batch header
5–10Entry/Addenda Count6NumericEntry and addenda records in the batch
11–20Entry Hash10NumericSum of receiving DFI IDs, last 10 digits
21–32Total Debit Entry Dollar Amount12Amount (cents)In cents
33–44Total Credit Entry Dollar Amount12Amount (cents)In cents
45–54Company Identification10AlphanumericSame as the batch header
55–73Message Authentication Code19BlankUsually blank
74–79Reserved6BlankBlank
80–87Originating DFI Identification8Numeric (routing)Same as the batch header
88–94Batch Number7NumericSame as the batch header

File Control Record (type 9)

The last real record. Its totals cover every batch in the file.

File Control layout
PositionFieldLengthTypeWhat goes here
1Record Type Code1NumericAlways 9
2–7Batch Count6NumericNumber of batches
8–13Block Count6NumericRecords ÷ 10, rounded up
14–21Entry/Addenda Count8NumericAll entry and addenda records
22–31Entry Hash10NumericSum of batch entry hashes, last 10 digits
32–43Total Debit Entry Dollar Amount in File12Amount (cents)In cents
44–55Total Credit Entry Dollar Amount in File12Amount (cents)In cents
56–94Reserved39BlankBlank

Transaction codes

The two-digit code in positions 2–3 of each entry says which kind of account it hits and whether money goes in (credit) or out (debit). General ledger (41–49) and loan (51–56) codes follow the same pattern.

CodeAccountDirectionMeaning
21CheckingCreditReturn or NOC (credit)
22CheckingCreditCredit (deposit)
23CheckingCreditPrenote, credit
24CheckingCreditZero-dollar credit with remittance
26CheckingDebitReturn or NOC (debit)
27CheckingDebitDebit (withdrawal)
28CheckingDebitPrenote, debit
29CheckingDebitZero-dollar debit with remittance
31SavingsCreditReturn or NOC (credit)
32SavingsCreditCredit (deposit)
33SavingsCreditPrenote, credit
34SavingsCreditZero-dollar credit with remittance
36SavingsDebitReturn or NOC (debit)
37SavingsDebitDebit (withdrawal)
38SavingsDebitPrenote, debit
39SavingsDebitZero-dollar debit with remittance

Standard Entry Class (SEC) codes

The SEC code in the batch header says how the payment was authorized, which decides the rules that apply to it.

CodeUsed for
PPDPrearranged payment and deposit (consumer)
CCDCorporate credit or debit
CTXCorporate trade exchange
WEBInternet-initiated or mobile entry
TELTelephone-initiated entry
IATInternational ACH transaction
ARCAccounts receivable entry
BOCBack office conversion
POPPoint-of-purchase entry
RCKRe-presented check entry

Entry hash and routing check digit

Entry hash

Add up the 8-digit Receiving DFI Identification of every entry in the batch (positions 4–11, the routing number without its last digit). Keep the rightmost 10 digits. The file control's hash is the sum of every batch hash, again keeping 10 digits.

Example: entries to routing numbers 011000015 and 122000247 give 01100001 + 12200024 = 0013300025.

Routing number check digit

Multiply the first 8 digits by 3, 7, 1, 3, 7, 1, 3, 7 and add the results. The check digit is the amount needed to reach the next multiple of 10. For 02100002: 0·3 + 2·7 + 1·1 + 0·3 + 0·7 + 0·1 + 0·3 + 2·7 = 29, so the check digit is 1 and the routing number is 021000021.

Example ACH file

A one-batch payroll file paying two employees, one with an addenda note. Open the viewer and paste it in to see each field decoded.

101 02100002119876543212611161405A094101FIRST EXAMPLE BANK HARBOR STREET BAKERY 5220HARBOR ST BAKERY 1987654321PPDPAYROLL 261118 1021000020000001 6220110000154400187733 0000184255EMP-0007 MARCO BELLINI 0021000020000001 6321220002477781200456 0000139520EMP-0014 LENA FISCHER 1021000020000002 705INCLUDES HOLIDAY PAY 00010000002 822000000300133000250000000000000000003237751987654321 021000020000001 9000001000001000000030013300025000000000000000000323775 9999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999 9999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999 9999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999

Return and change codes

Common return reason codes

CodeReason
R01Insufficient funds
R02Account closed
R03No account / unable to locate account
R04Invalid account number
R05Unauthorized debit to consumer account using corporate SEC code
R06Returned per ODFI request
R07Authorization revoked by customer
R08Payment stopped
R09Uncollected funds
R10Customer advises not authorized
R11Customer advises entry not in accordance with the terms of the authorization
R12Branch sold to another DFI
R13Invalid ACH routing number
R14Representative payee deceased
R15Beneficiary or account holder deceased
R16Account frozen
R17File record edit criteria
R20Non-transaction account
R21Invalid company identification
R22Invalid individual ID number
R23Credit entry refused by receiver
R24Duplicate entry
R29Corporate customer advises not authorized
R31Permissible return entry (CCD and CTX only)
R33Return of XCK entry

Notification of change codes

CodeWhat changed
C01Incorrect account number
C02Incorrect routing number
C03Incorrect routing number and account number
C04Incorrect individual name / receiving company name
C05Incorrect transaction code
C06Incorrect account number and transaction code
C07Incorrect routing number, account number and transaction code
C08Incorrect receiving DFI identification (IAT only)
C09Incorrect individual identification number
C13Addenda format error
C14Incorrect SEC code for outbound international payment

Frequently asked questions

How long is each line in an ACH file?

Exactly 94 characters. Text fields are left-justified and padded with spaces; numeric fields are right-justified and padded with zeros. A line that is shorter or longer is the most common reason a bank rejects a file.

What file extension does an ACH file use?

It doesn't matter to the format: .ach, .txt and .dat are all common. The file is plain ASCII text with one 94-character record per line. Ask your bank which extension its upload portal expects.

What is the entry hash?

The sum of the 8-digit Receiving DFI Identification (the first 8 digits of each routing number) for every entry in the batch. If the sum has more than 10 digits, keep only the rightmost 10. The file control's entry hash is the sum of the batch hashes, again keeping the last 10 digits.

Why does my ACH file need lines of all 9s at the end?

Records are grouped in blocks of 10 (the blocking factor in the file header). If the file's record count isn't a multiple of 10, it's padded with filler records of 94 nines. The block count in the file control is the number of blocks including the filler.

What is the difference between Immediate Destination and Immediate Origin?

Immediate Destination is the bank or ACH operator receiving the file, written as a space followed by its 9-digit routing number. Immediate Origin identifies you, the sender; banks usually assign it, and it is often 1 followed by your 9-digit EIN.

What is a prenote?

A zero-dollar test entry (transaction code 23, 28, 33 or 38) sent before live payments to confirm the routing and account number are valid. If no return or notification of change comes back, live entries can follow.

This guide summarizes the standard record formats. The Nacha Operating Rules are the authority, and your bank may have extra requirements; check its ACH file specifications.

Check a file against this layout

Drop an ACH file into the viewer to see every field decoded and every total verified.

Open the ACH viewer