JS library which allows you to calculate UK income tax for the year 2017/18.
GPL-3.0 License
This package allows you to calculate UK income tax. It also gives you a detailed breakdown of each part of the tax calculations.
You can install the package via the NPM registry.
npm install uk-tax-calculator
yarn add uk-tax-calculator
You will need to import the package into your project and then instantiate it with an income value;
import TaxCalculator from 'uk-tax-calculator';
const incomeTax = new TaxCalculator(60000);
console.log( 'Net Yearly Income: ' + incomeTax.getTotalNetPayPerYear() );
defaults
{
age: 30,
studentLoanPlan: 0,
blind: false,
pensionContributions: 0.00
}
This options reprents the age of the person you are calculating the income tax form.
This option represents the student loan plan of the person you are calculating the income tax for.
0 - No plan
1 - Plan 1
2 - Plan 2
Plan 1
Plan 2
No plan
This options represents whether or not the person is blind. Extra tax allowances are allocated for blind individuals.
This option represents the amount the person is paying into a pension.
Allows to change the options
import TaxCalculator from 'uk-tax-calculator';
const incomeTax = new TaxCalculator(60000);
incomeTax.setOptions({
age: 50,
blind: true,
pensionContributions: 5000.00,
studentLoanPlan: 1
});
Returns the current calculator options
Returns the current tax year settings
Returns a full breakdown of net income and tax deductions
import TaxCalculator from 'uk-tax-calculator';
const incomeTax = new TaxCalculator(60000);
console.log(
incomeTax.getTaxBreakdown()
);
Returns
{
netIncome: {
yearly: 42576.32,
monthly: 3548.03,
weekly: 818.78,
daily: 116.65
},
personalAllowance: 11500,
paye: {
rate_0: {
tax: 0,
carry: 48500
},
rate_20: {
tax: 6700,
carry: 15000
},
rate_40: {
tax: 6000,
carry: 0
},
rate_45: {
tax: 0,
carry: 0
}
},
nationalInsurance: {
rate_0: {
tax: 0,
carry: 996.8499999999999
},
rate_12: {
tax: 85.08,
carry: 287.8499999999999
},
rate_2: {
tax: 5.76,
carry: 0
}
},
studentLoan: {
plan: 'NO_PLAN',
threshold: 0,
rate: 0,
repayment: 0
}
}
Returns total net pay per year rounded to 2 decimal places