# payroll.gross-to-net
Status: needs review by a qualified payroll professional before it is published.
One employee's payslip for one pay period. This capability contains no rates,
no thresholds and no rounding of its own: each line comes from the capability
that owns it, and what is left here is the order of operations, which is
where payslips usually go wrong.
1. **Tax period** from the pay date and frequency (`payroll.tax-period`).
2. **Pension** (`payroll.pension-auto-enrolment`), if the employee is in a
scheme. Under a *net pay arrangement* the employee's contribution comes off
pay before tax; under *relief at source* it is taken from net pay, already
reduced by basic-rate relief, and taxable pay is untouched. Neither reduces
National Insurance or student loan pay: only salary sacrifice does that,
and salary sacrifice is a change to gross pay, so give the reduced gross.
3. **Income tax** on taxable pay (`payroll.income-tax`), cumulative or week
1 / month 1 as the code says.
4. **National Insurance** on this period's gross (`payroll.national-insurance`),
by the ordinary per-period method. Directors on the annual earnings period
method should call `payroll.national-insurance` directly.
5. **Student loans** on this period's gross (`payroll.student-loan`). An
employee with more than one undergraduate plan repays once, at the plan
with the lowest threshold, which is the largest single-plan deduction; a
postgraduate loan is repaid on top.
6. **Net pay** = gross - pension deduction - tax - employee NI - student loans.
A tax refund makes `tax` negative and increases net pay. Employer NI and the
employer pension contribution are reported but not deducted.
Out of scope: statutory payments (give them as part of gross), benefits in
kind, attachment of earnings orders, salary sacrifice arithmetic, and
deductions after net pay.
Sources: the rules are those of the capabilities listed above, each of which
cites its own. The order of deductions follows HMRC's "Employer further guide
to PAYE and NICs" (CWG2),
https://www.gov.uk/government/publications/cwg2-further-guide-to-paye-and-national-insurance-contributions,
and for student loans ("when the employee is on more than one plan, start
deductions for the plan with the lowest recovery threshold"; loans are worked
out on the same pay as secondary Class 1 NICs), HMRC's "Student loan and
postgraduate loan repayment guidance for employers",
https://www.gov.uk/guidance/special-rules-for-student-loans.
## Before you rely on this
**Not professional advice.** This capability calculates payroll figures from published rules. It is a software component for developers, not tax or legal advice. Rules change and every rate here has an effective date. Check that the dates cover your case. Verify results against the official sources listed above, and have a payroll professional review how you use it, before anyone relies on the output. Provided "as is" under its licence, without warranty.
**Unreviewed.** This capability's implementations agree in every language and pass its published test vectors, which were worked out from the official sources cited. But no qualified payroll professional has yet checked those vectors, or confirmed that the capability covers the cases it claims. Treat it as a draft. Do not use it for real people, money or decisions without your own expert review. Once a qualified reviewer signs off, this notice is replaced with their name, qualification and the date. Each new version needs fresh sign-off.
## Notices
Contains public sector information licensed under the Open Government
Licence v3.0 (https://www.nationalarchives.gov.uk/doc/open-government-licence/version/3/).
1.0.1 marks it unreviewed and adds its attribution notices (NOTICE). The code and the tests are unchanged.