Build a Bacs Standard 18 Payment File
Skill: Convert a payment run into a Bacs Standard 18 submission file
Region: United Kingdom Category: Payments — Bacs (Standard 18 / Bacstel-IP) Does: Takes a payment run (payroll, supplier payments, or Direct Debit collections) and produces a Bacs Standard 18 fixed-format file — user header, contra, 100-character data records, and user trailer — for submission via Bacstel-IP. Standard: Bacs Standard 18 file format (Bacstel-IP); 100-character records.
The AI builds the flat file. Submission requires your Service User Number (SUN), a signing certificate/smartcard, and a Bacs-approved software/bureau over Bacstel-IP. Bacs runs a 3-day cycle (input day → processing → entry on the third day). Validate the SUN, sort codes (modulus check), and transaction codes against your Bacs setup before submitting.
When this applies
- An organisation pays salaries/suppliers (credits) or collects Direct Debits (debits) in bulk through Bacs.
- Use Standard 18 when your software emits the classic fixed-width format (the alternative is Standard 18 within a Bacstel-IP payment instruction wrapper).
- Not for Faster Payments or CHAPS, and not for the SEPA/ISO 20022 world (see
global/payments/build-iso20022-pain001.md).
Conversion procedure
- Read the source. Accept CSV/JSON of payments (payee sort code, account number, name, amount, reference) plus the originator's SUN, name, and the contra (funding) account. Identify the processing day.
- Extract fields. For each payment: destination sort code (6 digits), account number (8 digits), account name (≤18 chars), amount (pence), and reference (≤18 chars). If the SUN, a sort code, account number, or amount is missing, stop and ask.
- Normalize. Amounts to pence, right-justified, zero-filled, 11 digits. Sort codes/account numbers digits only. Names/references upper-cased and space-padded to fixed width.
- Assemble the records:
VOL1/HDR1/HDR2labels (or the user headerUHL1), the data records (one per payment), a contra record, and the trailer (UTL1) carrying counts and value totals. - Emit the file aligned to 100 characters per record.
- Validate with the checklist.
Source → Standard 18 record map
| From the source | → Field (data record, 100 chars) |
|---|---|
| Destination sort code | positions 1–6 (destination sorting code) |
| Destination account number | positions 7–14 |
| Transaction code | positions 18–19 (e.g. 99, 17, 01, 0N, 0C, Z) |
| Originating sort code | positions 20–25 |
| Originating account number | positions 26–33 |
| Amount in pence | positions 35–45 (right-justified, zero-filled) |
| Originator's name (SUN short name) | positions 46–63 |
| Payment reference | positions 64–81 |
| Destination account name | positions 82–99 |
(Exact column ranges vary by software profile; confirm against your Bacs-approved package.)
Document structure
Standard 18 file
├── VOL1 / HDR1 / HDR2 (volume + file header labels)
├── UHL1 (user header label — processing date, SUN)
├── data record ... (one per payment, 100 chars, transaction code 99/17/01/0N/0C)
├── contra record (code Z) (balancing debit/credit to the originator account)
└── UTL1 (user trailer — debit count/value, credit count/value)
Code tables
Transaction codes (selected)
| Code | Meaning |
|---|---|
99 |
Credit (Bacs Direct Credit — payroll/supplier) |
17 |
First Direct Debit collection of a new instruction |
18 |
Re-presented Direct Debit |
19 |
Final Direct Debit |
01 |
Regular Direct Debit |
0C |
New Direct Debit instruction (AUDDIS) |
0N |
Cancel instruction (AUDDIS) |
Z |
Contra record |
Record alignment
| Field | Rule |
|---|---|
| Amount | Pence, right-justified, zero-filled |
| Sort code / account | Digits only, fixed width |
| Names / references | Upper-case, left-justified, space-padded |
Calculation rules
- Amount is the value in pence (e.g. £1,250.00 →
125000), right-justified and zero-filled to the field width. - Contra record value = total of credits in the batch (for a Direct Credit run) so the file balances.
- UTL1 totals: credit count and credit value = number/sum of
99records; debit count and value = number/sum of DD records. - Each batch must balance: Σ data-record amounts = contra amount; flag any out-of-balance.
Worked example (end-to-end)
Input — two-salary Direct Credit run
SUN: 123456 (PAYROLL LTD), processing date 16 Jun 2026
Originating account: sort 20-00-00, account 12345678
Payee 1: 40-01-02 / 11112222, JOHN SMITH, ref SALARY JUN, £1,250.00
Payee 2: 30-05-06 / 33334444, JANE DOE, ref SALARY JUN, £2,000.00
Total credits: £3,250.00
After normalization (intermediate)
amount1 -> 125000 (pence) ; amount2 -> 200000 (pence)
transaction code 99 (credit) ; contra Z = 325000 ; credit count = 2
Output — Standard 18 file
VOL1PAYROLL
UHL1 6168 123456 PAYROLL LTD MULTI
40010211112222 992000001234567800000125000PAYROLL LTD SALARY JUN JOHN SMITH
30050633334444 992000001234567800000200000PAYROLL LTD SALARY JUN JANE DOE
20000012345678 Z 2000001234567800000325000PAYROLL LTD CONTRA PAYROLL LTD
UTL1000000000000000003250000000002000000000000000000
Normalisations shown: amounts to pence (£1,250.00 → 00000125000); transaction code 99 for credits; contra record (Z) balances the run at 325000; UTL1 carries credit count 2 and total value 3250000 (pence). (Column positions above are illustrative — align to your Bacs-approved software's exact Standard 18 layout.)
Validation checklist
- SUN, originating sort code/account, and processing date captured; nothing invented
- Every payment has a valid 6-digit sort code (modulus check) and 8-digit account number
- Amounts converted to pence, right-justified and zero-filled to field width
- Correct transaction code per record (99 credit / 17/18/19/01 DD / Z contra)
- Contra record balances the batch; file is in balance
- UTL1 debit/credit counts and values reconcile to the data records
- Records aligned to the exact Standard 18 column layout of your Bacs-approved software
- Submitted via Bacstel-IP within the 3-day processing cycle
Last updated: 2026-06-13 — verify the exact Standard 18 column layout, transaction codes, and Bacstel-IP submission rules against your Bacs-approved software before use.