FinchContext
Run with

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


Conversion procedure

  1. 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.
  2. 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.
  3. 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.
  4. Assemble the records: VOL1/HDR1/HDR2 labels (or the user header UHL1), the data records (one per payment), a contra record, and the trailer (UTL1) carrying counts and value totals.
  5. Emit the file aligned to 100 characters per record.
  6. 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


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.0000000125000); 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


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.