Skip to content

Commit

Permalink
Update readme in light of adding the new tax year
Browse files Browse the repository at this point in the history
  • Loading branch information
sgb-io committed Mar 10, 2024
1 parent 0455521 commit eb32d94
Showing 1 changed file with 27 additions and 4 deletions.
31 changes: 27 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,19 @@
# HMRC Income Tax

An ultra-fast, tiny TypeScript implementation of UK Income Tax & National Insurance calculations. See it in action on [SavingTool.co.uk](https://savingtool.co.uk).
An ultra-fast, tiny TypeScript implementation of common UK Income Tax & National Insurance calculations. See it in action on [SavingTool.co.uk](https://savingtool.co.uk).

This library makes it easy to calculate, based on a PAYE taxable salary:

- Personal Allowance
- Income Tax
- Employee National Insurance Contributions (Class 1, Category A only)
- Student Loan Repayments (Plans 1, 2, 4, 5 or postgrad)

Multiple versions of the HMRC rates can be supported, although only the follwing years have been implemented:

- 2024/25
- 2023/24 (default)
- 2022/23
- 2023/24

Works in all modern browsers and Node.js (LTS recommended).

Expand Down Expand Up @@ -39,28 +47,36 @@ import {
calculateStudentLoanRepayments,
} from "@saving-tool/hmrc-income-tax";

const taxYear = "2022/23";

// Mark S.
const taxableAnnualIncome = 53_900;

const personalAllowance = calculatePersonalAllowance({ taxableAnnualIncome });
const personalAllowance = calculatePersonalAllowance({
taxableAnnualIncome,
taxYear,
});
// => 12570

const incomeTax = calculateIncomeTax({
personalAllowance,
taxableAnnualIncome,
taxYear,
});
const { basicRateTax, higherRateTax, additionalRateTax } = incomeTax;
const totalIncomeTax = basicRateTax + higherRateTax + additionalRateTax;
// => 8992

const nationalInsuranceContributions = calculateEmployeeNationalInsurance({
taxableAnnualIncome,
taxYear,
});
// => 5471

const studentLoanRepayments = calculateStudentLoanRepayments({
taxableAnnualIncome,
studentLoanPlanNo: 1,
taxYear,
});
// => 3162

Expand All @@ -82,22 +98,29 @@ import {
calculateEmployeeNationalInsurance,
} from "@saving-tool/hmrc-income-tax";

const taxYear = "2022/23";

// Irv B.
const taxableAnnualIncome = 160_000;

const personalAllowance = calculatePersonalAllowance({ taxableAnnualIncome });
const personalAllowance = calculatePersonalAllowance({
taxableAnnualIncome,
taxYear,
});
// => 0

const incomeTax = calculateIncomeTax({
personalAllowance,
taxableAnnualIncome,
taxYear,
});
const { basicRateTax, higherRateTax, additionalRateTax } = incomeTax;
const totalIncomeTax = basicRateTax + higherRateTax + additionalRateTax;
// => 57589

const nationalInsuranceContributions = calculateEmployeeNationalInsurance({
taxableAnnualIncome,
taxYear,
});
// => 8919

Expand Down

0 comments on commit eb32d94

Please sign in to comment.