Work out your take-home pay
Income tax, National Insurance and net pay for any UK salary, 2026-27.
The UK operates three separate income tax regimes, more than a dozen National Insurance category letters, and five student loan plans, all of which a compliant payroll must apply correctly on every pay run [1][2]. With around 30.2 million people paid through PAYE in December 2025, each reported to HM Revenue and Customs on or before payday, the margin for calculation error is effectively zero [3]. A UK payroll API is the software component that encodes all of this and exposes it as programmable endpoints.
For a development team, the appeal is clear: rather than build and maintain the UK statutory rulebook in-house, a platform calls an engine that already holds HMRC recognition and updates itself each April. The difficulty is knowing what a genuine UK payroll engine must handle, so a team can tell a complete engine from a thin calculator wrapped in an API.
This guide walks through the technical surface a UK payroll API has to cover: income tax across England, Scotland and Wales, National Insurance and its category letters, tax code operation, student loans, auto-enrolment, and the Real Time Information submissions that close every pay run. It is written for software engineers, product leaders and technical founders evaluating or integrating a UK payroll engine.
Key takeaways
- A UK payroll API must apply income tax across three regimes, National Insurance across every category letter, and five student loan plans, all current for the 2026-27 tax year [1][2].
- Employer National Insurance is charged at 15% on earnings above the £5,000 Secondary Threshold for 2026-27 [2].
- Tax codes can be operated on a cumulative or a week 1 / month 1 basis, and an engine must handle both [4].
- Auto-enrolment uses a £10,000 earnings trigger and a qualifying earnings band of £6,240 to £50,270 for 2026-27, with a minimum 8% total contribution [5][6].
- Every pay run ends with a Full Payment Submission to HMRC, filed on or before payday under RTI [7].
Income tax: three regimes, one engine
The single most misunderstood feature of UK payroll is that "UK income tax" is not one thing. An employee's tax is determined by where they live, and a payroll engine must route each employee to the correct regime based on their tax code prefix.
England and Northern Ireland use three bands above the Personal Allowance of £12,570: a basic rate of 20% up to £50,270, a higher rate of 40% up to £125,140, and an additional rate of 45% above that [1]. Wales sets its own rates but has so far matched the England and Northern Ireland figures, and Welsh taxpayers carry a `C` prefix on their tax code. Scotland is materially different.
Scottish income tax has six bands
Scotland operates six income tax bands for 2026-27, and Scottish taxpayers carry an `S` prefix on their tax code [8]. The rates and thresholds differ sharply from the rest of the UK, which is why an engine cannot treat Scotland as a variation on the English tables.
| Scottish band | Rate 2026-27 |
|---|---|
| Starter rate | 19% |
| Basic rate | 20% |
| Intermediate rate | 21% |
| Higher rate | 42% |
| Advanced rate | 45% |
| Top rate | 48% |
The Scottish higher-rate threshold sits at £43,662, well below the £50,270 point where the rest of the UK moves into higher rate [9]. A payroll engine that hard-codes a single higher-rate threshold will overpay or underpay every Scottish employee earning between roughly £43,662 and £50,270. Handling this correctly is a baseline requirement, not an advanced feature, for any HMRC-recognised payroll engine, as covered in this overview of what a payroll API is and how it works.
Tax code operation: cumulative versus week 1 / month 1
Applying the right rate is only half the calculation. The engine must also apply the tax code on the correct basis. On a cumulative basis, each pay period considers all pay and tax so far in the year, so the deduction self-corrects over time. On a week 1 / month 1 basis, the engine ignores everything before the current period and taxes each payment as though it were the first of the year [4].
HMRC issues codes on a week 1 / month 1 basis in specific circumstances, for example where a revised code is lower than the last cumulative code, to prevent a large one-off deduction [4]. An engine must read the basis flag on each code and switch behaviour accordingly. It must also respect the rule that no single PAYE deduction may exceed 50% of an employee's gross pay, a built-in safeguard set out in HMRC's employer guidance [10].
National Insurance and its category letters
National Insurance is calculated separately from income tax and uses its own thresholds. For 2026-27, employees pay 8% on earnings between the Primary Threshold of £12,570 and the Upper Earnings Limit of £50,270, then 2% above that. Employers pay 15% on earnings above the £5,000 Secondary Threshold [2]. The employer rate rose from 13.8% to 15% on 6 April 2026, one of the most consequential payroll cost changes of the decade.
The complexity for an engine is the category letter. Each employee has a National Insurance category that determines which rates and reliefs apply, and employers must apply the correct letter when they run payroll [11]. Most employees are category A, but a wide range of reliefs sit behind other letters.
| Category group | Example letters | Employer relief |
|---|---|---|
| Standard | A, B, C, J | None, 15% above the Secondary Threshold |
| Under 21 and apprentices | M, H | 0% employer NI up to £50,270 |
| Veterans | V | 0% employer NI for the first 12 months of civilian employment |
| Freeport | F, I, S, L | 0% employer NI up to £25,000 |
| Investment Zone | N, E, K, D | 0% employer NI up to £25,000 |
Freeport and Investment Zone are two separate relief schemes with distinct category letters, even though both cap employer relief at £25,000 of earnings [11]. An engine that conflates them will misreport. Handling every letter, and the earnings caps attached to each, is part of the full statutory coverage a platform should expect from an embeddable UK payroll engine.
Directors are assessed annually
Company directors are a distinct case. Directors are office holders, and their National Insurance is calculated on an annual earnings period rather than per pay period, even when they are paid monthly [12]. At the final payment of the tax year, the engine must reassess NI on the director's total annual earnings. This trips up systems built only for standard monthly employees, and it is a frequent source of error for owner-managed businesses paying a director a low salary. A payroll engine must model the annual basis natively.
Student loans: five plans, two rates
Student loan deductions run through payroll alongside tax and National Insurance, and from 6 April 2026 there are five plan types plus the postgraduate loan. Plan 5 entered repayment for the first time on that date and is collected in the same way as plans 1, 2 and 4 [13]. An engine must have supported Plan 5 before the start of the 2026-27 tax year.
| Plan | Annual threshold 2026-27 | Deduction rate |
|---|---|---|
| Plan 1 | £26,900 | 9% |
| Plan 2 | £29,385 | 9% |
| Plan 4 | £33,795 | 9% |
| Plan 5 | £25,000 | 9% |
| Postgraduate Loan | £21,000 | 6% |
The calculation deducts the pay-period threshold from earnings, then applies the plan rate, rounding down to the nearest whole pound [14]. There is no Plan 3, a common source of confusion. Where an employee has both a student loan and a postgraduate loan, the engine deducts both, and the postgraduate loan is taken first [15]. The postgraduate loan uses a 6% rate, not the 9% that applies to plans 1, 2, 4 and 5 [13], so an engine that assumes a single rate across all loans will miscalculate.
Auto-enrolment assessment on every pay run
Workplace pension duties are not a one-off setup task. Under automatic enrolment, an employer must assess every worker on every pay run against age and earnings criteria, and enrol those who qualify [5]. A payroll engine has to run that assessment automatically, because a worker's status can change from one period to the next as their earnings move.
For 2026-27, the earnings trigger for automatic enrolment is retained at £10,000, and the qualifying earnings band runs from a lower limit of £6,240 to an upper limit of £50,270 [5]. Contributions are calculated on the slice of pay inside that band.
| Auto-enrolment parameter | 2026-27 value |
|---|---|
| Earnings trigger | £10,000 |
| Qualifying earnings, lower limit | £6,240 |
| Qualifying earnings, upper limit | £50,270 |
| Minimum total contribution | 8% of qualifying earnings |
| Minimum employer contribution | 3% of qualifying earnings |
The statutory minimum total contribution is 8% of qualifying earnings, of which the employer must pay at least 3% [6]. A complete engine performs the assessment, calculates the contributions and supports the main master-trust schemes such as NEST, Smart Pension and The People's Pension natively, so the calling platform does not have to build pension logic itself. Businesses running this in-house often move to dedicated payroll software precisely to automate the per-run assessment.
Closing the loop: RTI submissions
Every UK pay run ends with a report to HMRC. Since Real Time Information became mandatory in 2013, an employer must file a Full Payment Submission on or before each payday, carrying the pay, tax, National Insurance, student loan and statutory payment figures for every employee [7]. The engine constructs this submission from the finalised pay run and transmits it electronically.
Software that files RTI must meet HMRC's published specification, and software that passes appears on the HMRC-recognised list [16]. Recognition is granted against the Real Time Information specifications for the tax year, with developers applying through HMRC's Software Developer Support Team [17]. For a UK payroll API, holding recognition is the entry threshold, since every serious product in the market carries the badge.
Authentication, testing and the developer surface
Connecting to HMRC involves a technical layer that a good API abstracts away. HMRC's own services use OAuth 2.0 to issue access tokens, passed as bearer tokens on each call, and every integration must be validated in a sandbox before production credentials are granted [18][19]. A recognised payroll engine handles this transport and authentication itself, so the platform integrates against one clean interface rather than implementing HMRC's rules directly. This is where developer experience separates products: public documentation, a sandbox and self-serve access let a team evaluate the REST API for UK payroll without a sales process.
Filing on time matters because RTI penalties are automatic. A late FPS attracts a fixed monthly penalty scaling with headcount, from £100 for one to nine employees up to £400 for 250 or more, with no penalty where the return reaches HMRC within three days of payday [20]. Filing the FPS automatically at pay-run finalisation removes the manual step that causes most late submissions.
Work out take-home pay against the 2026-27 rules
Before integrating an engine, a developer can sanity-check the calculation logic against a known-good reference using the Moonworkers UK salary calculator, which applies the 2026-27 PAYE and National Insurance rules to any gross salary.
£ per month
e.g. 1257L, S1257L, BR, D0
S = Scotland · C = Wales · W1/M1 = non-cumulative
Enter a salary or hourly rate above
About this calculator
This calculator gives you a close estimate of your UK payroll deductions for 2026-27, using HMRC's exact percentage method. It covers the vast majority of employees on standard tax codes, but it won't match your payslip to the penny in every case. Edge cases it does not cover include in-year tax code changes, K-code carry-forwards, Week 53 adjustments, payrolled benefits in kind, and multi-employment NI deferral. Powered by the same engine as the Moonworkers Payroll API.
Frequently asked questions
Why might the result differ from my payslip?
This calculator uses your current gross pay and tax code to produce an estimate. Your employer may apply adjustments not covered here, such as mid-year tax code changes, K-code carry-forwards, or benefits in kind processed through payroll. For most employees on a standard tax code these differences are negligible.
What tax code should I enter?
Use the tax code shown on your most recent payslip or the PAYE Coding Notice (P2) from HMRC. If you're not sure, 1257L is the standard code for most employees resident in England, Wales, or Northern Ireland. Use S1257L for Scotland or C1257L for Wales if you pay Scottish or Welsh income tax.
Which NI category applies to me?
Most employees use Category A. Use M if you are under 21, H if you are an apprentice under 25, or C if you are over State Pension age. Your employer is responsible for assigning the correct category — if in doubt, check your payslip.
Which student loan plan am I on?
Your plan depends on when and where you studied. Plan 1 covers students who started before September 2012. Plan 2 is for English and Welsh students who started from September 2012 to July 2023. Plan 5 applies to English students who started from August 2023. Plan 4 covers Scottish students. You can check your plan at gov.uk or on your payslip.
What is the YTD cumulative PAYE mode?
HMRC's standard method calculates income tax on your total earnings to date each period, then subtracts tax already paid. If you're mid-year and want to see exactly what tax should be deducted in a specific period, expand the Year-to-date section and enter your running totals from previous periods only.
Conclusion
A UK payroll API earns its place by encoding a genuinely intricate rulebook and keeping it current. The three tax regimes, the National Insurance category letters and their reliefs, the annual basis for directors, five student loan plans on two rates, per-run auto-enrolment assessment, and the RTI submission that closes every period are not optional extras. They are the minimum surface a UK payroll engine has to cover to be correct, and each is a place an incomplete implementation quietly fails.
The practical takeaway for a technical team is to evaluate against that whole surface, not against the parts that are easy to demonstrate. An engine that calculates a standard category A employee in England is straightforward; the value is in the Scottish higher-rate threshold, the postgraduate loan rate, the director paid monthly and the worker whose earnings cross the auto-enrolment trigger mid-year. As more platforms embed UK payroll rather than build it, the engines that model the full specification, and prove it through HMRC recognition, are the ones worth integrating.
Frequently asked questions
What UK statutory calculations must a payroll API perform?
A complete UK payroll API calculates income tax across the England and Northern Ireland, Scottish and Welsh regimes, National Insurance across every category letter, student loan deductions across all five plans plus the postgraduate loan, and auto-enrolment pension assessment on every pay run [1][2][13]. It must also produce statutory pay, year-end forms and the RTI submissions that report each pay run to HMRC.
How does a payroll API handle Scottish and Welsh tax?
The engine routes each employee to the correct regime using the tax code prefix: `S` for Scotland, `C` for Wales, and no prefix for England and Northern Ireland [8]. Scotland has six income tax bands with a higher-rate threshold of £43,662, distinct from the £50,270 threshold used in the rest of the UK for 2026-27 [9]. An engine must apply the full Scottish band structure, not a single adjusted rate.
Does a UK payroll API need to be HMRC-recognised?
To file Real Time Information for live payroll, yes. HMRC recognition certifies that the software meets the specification for sending RTI submissions such as the FPS and EPS, and recognised products appear on the official GOV.UK list [16]. A team should confirm the specific product is recognised before relying on it for production filing, because recognition is the baseline every serious UK payroll product meets.
How are student loans calculated through a payroll API?
The engine deducts the pay-period threshold from earnings and applies the plan rate, rounding down to the nearest pound [14]. Plans 1, 2, 4 and 5 use a 9% rate; the postgraduate loan uses 6% [13]. Where an employee repays both a student loan and a postgraduate loan, the engine takes the postgraduate loan first [15].

