How a NACHA ACH File Works, and How to Build One from a Spreadsheet
The six ACH record types, batch rules, entry hashes and prenotes explained with a payroll example, plus the checks to make before a file goes to your bank.

How a NACHA ACH File Works, and How to Build One from a Spreadsheet
Paying staff or suppliers by ACH from a small business usually starts with your bank's online portal. Once the number of payees grows, many banks let you upload a NACHA formatted file instead of typing each payment. The format is decades old, strictly fixed width and unforgiving: one character out of place and the file is rejected.
The record types
Every line in an ACH file is exactly 94 characters, and the first character says what it is:
- 1 File header: the immediate destination (your bank's routing number), the immediate origin (your company's ID at the bank), the creation date and time and both names.
- 5 Batch header: the service class, company name, company ID, SEC code such as PPD or CCD, a 10 character entry description like PAYROLL and the effective entry date.
- 6 Entry detail: one payment, with a two digit transaction code, the receiving routing number, account number, amount in cents, an ID number, the receiver's name and a trace number.
- 7 Addenda: optional extra text for the entry before it, or return and change information in files coming back from the bank.
- 8 Batch control: the count of entries and addenda, the entry hash, and total debits and credits for the batch.
- 9 File control: the same totals for the whole file, plus the batch and block counts.
The file is padded with lines of nines so the record count is a multiple of ten, a leftover from the days of tape blocks.
Transaction codes and the entry hash
The transaction code combines account type and direction. For checking accounts 22 is a credit and 27 a debit; for savings they are 32 and 37. Codes 23, 28, 33 and 38 are prenotes, zero-dollar tests. The entry hash adds up the first eight digits of every receiving routing number and keeps the last ten digits of the sum. It lets the bank detect a changed routing number even when the totals still balance.
Worked example
The NACHA ACH file viewer and builder includes a payroll list of four employees with columns for name, routing, account, amount, type, direction, ID and memo. Load it and set the effective date to 2026-11-20.
The tool builds one PPD batch. Jordan Lee is paid 1,520.75, Sam Rivera 1,385.10, Alex Chen 2,004.00 and Priya Patel 1,650.40. Sam Rivera's account type is savings, so that entry gets code 32; the others get 22. Jordan and Sam have the memo November payroll, which becomes an addenda record for each.
Because every entry is a credit, the batch uses service class 220, credits only. The batch control counts 6 records (4 entries and 2 addenda), shows total credits of 6,560.25 and an entry hash of 0017900997. Add the file header, batch header and file control, and the file has exactly 10 lines, one block, with no padding needed. The validation line reads passed.
Switch to reading mode by opening the downloaded .ach file, and the same numbers come back from the parsed records, which is a useful round trip test.
Checks worth running on any ACH file
Before uploading a file from payroll software or your own spreadsheet, open it in the viewer and look for these:
- Every record is 94 characters.
- Every routing number passes the check digit test.
- Batch and file entry counts, hashes and totals agree with the entries.
- The block count matches the number of lines.
- No debit appears in a credits-only batch.
Common mistakes
Using a sample immediate origin. The default values are placeholders. Your bank tells you the exact immediate destination, immediate origin and company ID to use, and these often differ from the routing number or EIN you might expect.
Skipping the prenote. For a new employee or supplier, a prenote file catches a wrong account number before real money goes astray. With the offset option on, the offset entry in a prenote file is also a zero-dollar prenote, so nothing moves until the live run.
Guessing about offsets. Some banks want every batch balanced by an offset to your funding account, while most add it themselves. Ask before turning it on.
Typing amounts as text. A value such as TBC in the amount column cannot be read, so that row is left out and a warning names it. Fix the sheet before you send anything.
Weekend effective dates. If you leave the date blank, the tool uses the next weekday, but it does not know bank holidays. Check the Federal Reserve calendar for holidays.
Last step
Send the built file through your bank's normal upload channel and keep the Excel list of entries with your payroll records. If the bank rejects the file, their error message plus the viewer's validation list usually points to the field at fault.



&c=%23991b1b&k=business)