How the United Kingdom sole trader calculator is verified
Inputs
| Input | Field | Type |
|---|---|---|
| Annual profit after expenses (GBP) | annualProfit | number |
The formula
Each derived value below is computed by the Valem engine from the expression shown, in this order. Nothing else runs — there is no hidden code path.
| Derived value | Field | Formula (JSONata) |
|---|---|---|
| Personal allowance | personalAllowance | $round($max([0, $const.fullAllowance - $max([0, annualProfit - $const.taperThreshold]) / 2]), 2) |
| Taxable Income | taxableIncome | $round($max([0, annualProfit - personalAllowance]), 2) |
| Income tax | incomeTax | $round($const.basicRate * $min([taxableIncome, $const.basicBand]) + $const.higherRate * $max([0, $min([taxableIncome, $const.additionalThreshold]) - $const.basicBand]) + $const.additionalRate * $max([0, taxableIncome - $const.additionalThreshold]), 2) |
| Class 4 National Insurance | class4NIC | $round($const.nicMainRate * $max([0, $min([annualProfit, $const.nicUpperLimit]) - $const.nicLowerLimit]) + $const.nicUpperRate * $max([0, annualProfit - $const.nicUpperLimit]), 2) |
| Net income / year | netIncome | $round($max([0, annualProfit - incomeTax - class4NIC]), 2) |
Rates and thresholds
The expressions above read these as $const. They are the figures the annual refresh replaces, so they live as data rather than being written into the formulas — which is what makes a year-on-year change a one-line diff instead of an edit to arithmetic.
| Constant | Value |
|---|---|
fullAllowance | 12570 |
taperThreshold | 100000 |
basicBand | 37700 |
additionalThreshold | 125140 |
basicRate | 0.2 |
higherRate | 0.4 |
additionalRate | 0.45 |
nicLowerLimit | 12570 |
nicUpperLimit | 50270 |
nicMainRate | 0.06 |
nicUpperRate | 0.02 |
Test vectors (3)
Every case is executed against this model on each build, by the Java engine and independently by a JavaScript one. A mismatch of a single cent fails the build, so the page cannot ship advertising a figure the model no longer produces.
Case 1 — 50,000 GBP profit — full allowance, basic rate only
given annualProfit | 50000 |
|---|---|
expect personalAllowance | 12570 |
expect taxableIncome | 37430 |
expect incomeTax | 7486 |
expect class4NIC | 2245.8 |
expect netIncome | 40268.2 |
Case 2 — 120,000 GBP profit — inside the allowance taper
given annualProfit | 120000 |
|---|---|
expect personalAllowance | 2570 |
expect taxableIncome | 117430 |
expect incomeTax | 39432 |
expect class4NIC | 3656.6 |
expect netIncome | 76911.4 |
Case 3 — 150,000 GBP profit — allowance fully tapered away, into the 45% band
given annualProfit | 150000 |
|---|---|
expect personalAllowance | 0 |
expect taxableIncome | 150000 |
expect incomeTax | 53703 |
expect class4NIC | 4256.6 |
expect netIncome | 92040.4 |
Sources
- HMRC — Income Tax rates and Personal Allowances (2026/27) · checked 2026-08-22
- HMRC — Self-employed National Insurance rates: Class 4 at 6% and 2% (2026/27) · checked 2026-08-22
Check it yourself — and reuse it
The whole model as JSON — inputs, outputs, formulas, vectors and sources in one re-runnable document.
This model is published under CC BY 4.0: use it, adapt it, build on it, with attribution. The licence covers the model — the expression of each rule and the arrangement of the catalog. The rates and thresholds are law, and nobody licenses those; the sources above are where they come from.
← Back to the United Kingdom sole trader calculator
Built with Valem — a live, verifiable calculator you can fork and embed.