File Header

Identifies the destination and origin, file creation time, blocking factor, and format code.

101 990000000 9900000012607251345A094101EXAMPLE DESTINATION EXAMPLE ORIGIN

Hover a highlighted field to inspect it.

Entry hash

Add the first eight digits of every receiving DFI identification from entry detail records. Keep only the lowest ten digits of that sum. Batch control (positions 11–20) and file control (positions 22–31) must match.

In the sample file, the batch control entry hash is 0000198100 and the credit total is 0000000013023 cents ($130.23).

Block padding

ACH files are blocked in groups of ten 94-character records. If the logical records do not fill the last block, the file ends with one or more lines containing only the digit 9.

This sample contains ten physical records: six logical records plus four all-9 padding lines.

Record order in a credits-only file

  1. File Header (type 1)
  2. Batch Header (type 5)
  3. One or more Entry Detail records (type 6)
  4. Optional Addenda records (type 7) after entries that need them
  5. Batch Control (type 8)
  6. File Control (type 9)
  7. Blocking padding lines containing only the digit 9

NACHA file layout: every field position

Positions are 1-based and inclusive. Numeric fields are right-aligned with leading zeros; text fields are left-aligned and padded with spaces.

Type 1: File Header

Identifies the destination and origin, file creation time, blocking factor, and format code.

PositionsFieldContents
1Record type codeAlways 1 for the file header.
2–3Priority codeUsually 01.
4–13Immediate destinationTen-character routing number of the receiving bank or ACH operator.
14–23Immediate originTen-character company or originator routing number.
24–29File creation dateYYMMDD when the file was created.
30–33File creation timeHHMM in 24-hour time.
34File ID modifierA–Z or 0–9. Distinguishes multiple files created the same day.
35–37Record sizeAlways 094.
38–39Blocking factorAlways 10 for ACH files.
40Format codeAlways 1.
41–63Immediate destination nameBank or operator name.
64–86Immediate origin nameCompany or originator name.
87–94Reference codeOptional reference for internal use.

Type 5: Batch Header

Describes the company, SEC code, entry description, effective date, and originating DFI.

PositionsFieldContents
1Record type codeAlways 5 for a batch header.
2–4Service class code220 = credits only in this generator.
5–20Company nameName that appears on the receiver's statement.
21–40Company discretionary dataOptional internal data.
41–50Company identificationTax ID or other company ID assigned by the ODFI.
51–53Standard entry class codeCCD for vendors or PPD for payroll.
54–63Company entry descriptionShort description such as PAYROLL or VENDOR PAY.
64–69Company descriptive dateOptional date shown to the receiver.
70–75Effective entry dateYYMMDD when entries should settle.
76–78Settlement dateFilled by the ACH operator; usually blank in outgoing files.
79Originator status code1 = live, 0 = test.
80–87Originating DFI identificationFirst eight digits of the ODFI routing number.
88–94Batch numberSequential batch number within the file.

Type 6: Entry Detail

One payment or prenote. Contains routing, account, amount, recipient name, and trace number.

PositionsFieldContents
1Record type codeAlways 6 for an entry detail.
2–3Transaction code22/32 = credit, 23/33 = prenote, 27/37 = debit (not generated here).
4–11Receiving DFI identificationFirst eight digits of the recipient routing number.
12Check digitNinth digit of the routing number.
13–29DFI account numberRecipient account number, left-justified.
30–39AmountTen-digit amount in cents with leading zeros.
40–54Individual identification numberOptional employee or vendor ID.
55–76Individual nameRecipient name as it should appear on the statement.
77–78Discretionary dataOptional two-character field.
79Addenda record indicator0 = no addenda, 1 = addenda record follows.
80–94Trace numberODFI routing (8) plus a unique seven-digit sequence.

Type 7: Addenda

Optional payment-related text linked to the preceding entry detail record.

PositionsFieldContents
1Record type codeAlways 7 for addenda.
2–3Addenda type code05 = payment-related information.
4–83Payment related informationUp to 80 characters of reference text.
84–87Addenda sequence numberUsually 0001 for a single addenda.
88–94Entry detail sequence numberLast seven digits of the related trace number.

Type 8: Batch Control

Batch totals: entry/addenda count, entry hash, debit and credit amounts.

PositionsFieldContents
1Record type codeAlways 8 for batch control.
2–4Service class codeMust match the batch header.
5–10Entry/addenda countTotal type 6 and type 7 records in the batch.
11–20Entry hashSum of receiving DFI IDs, lowest ten digits.
21–32Total debit entry dollar amountZero for credits-only files.
33–44Total credit entry dollar amountSum of entry amounts in cents.
45–54Company identificationMust match the batch header.
55–73Message authentication codeOptional; usually blank.
74–79ReservedBlank.
80–87Originating DFI identificationMust match the batch header.
88–94Batch numberMust match the batch header.

Type 9: File Control

File-level totals, block count, and hash. Followed by all-9 padding records.

PositionsFieldContents
1Record type codeAlways 9 for file control.
2–7Batch countNumber of batch headers in the file.
8–13Block countTotal physical blocks of ten records.
14–21Entry/addenda countTotal type 6 and type 7 records in the file.
22–31Entry hashMust match batch control entry hash.
32–43Total debit entry dollar amountZero for credits-only files.
44–55Total credit entry dollar amountMust match batch credit total.
56–94ReservedBlank.

Why banks reject NACHA files

The ACH file validator checks all of these in your browser. Transaction codes in positions 2–3 of each entry are explained in ACH transaction codes, and the SEC code in the batch header in CCD vs PPD.

What this guide does not cover

Banks can require different header values, naming, testing steps, and effective-date rules. This guide explains public NACHA layout concepts but does not claim independently verified compliance or guarantee bank acceptance.

Next steps

Validate an ACH file, open a NACHA file in Excel, download the import template, or create a file from Excel or CSV.

Questions

What is a NACHA file?

A NACHA file (also called an ACH file) is the plain text file a business uploads to its bank to send a batch of ACH payments, such as payroll direct deposits or vendor payments. The layout is set by Nacha, the organization that runs the ACH network rules, which is where the name comes from.

What file extension does a NACHA file use?

Usually .ach or .txt. The extension does not matter to most banks; the content does. It must be plain ASCII text with 94-character lines, uppercase letters and no tabs.

Why does every line have to be exactly 94 characters?

The format is fixed-width: each field is identified only by its position, so a missing or extra space shifts every field after it. Most bank rejections of hand-edited files come from a line that is 93 or 95 characters long.

What is the entry hash in a NACHA file?

The sum of the first eight digits of every receiving bank routing number in the batch, keeping only the last ten digits. It appears in the batch control and file control records so the bank can detect lost or altered entries.

Do I need to write a NACHA file by hand?

No. Most payroll and accounting systems export one, and if yours does not, you can build one from an Excel or CSV list of payments with a generator. Writing one by hand is only practical for testing.