npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@casomoltd/paye-calc

v0.5.19

Published

UK PAYE take-home pay calculator — income tax, NI, pensions, student loans

Readme

@casomoltd/paye-calc

UK PAYE take-home pay calculator. Handles income tax, National Insurance, pensions, and student loans for 2023-24 through 2026-27.

Install

npm install @casomoltd/paye-calc

Public on the npm registry — no auth or .npmrc config needed.

Usage

import {
  TakeHomePay,
  GrossAnnual,
  NetAnnual,
  PensionPercent,
  PensionBasis,
  StudentLoanPlan,
  Period,
} from '@casomoltd/paye-calc';

const calc = new TakeHomePay('2025-26', 'rUK');
calc.setSalary(GrossAnnual(55000));
calc.setPension(PensionPercent(5));
calc.setPensionBasis(PensionBasis.AutoEnrolment);
calc.setStudentLoanPlans(
  new Set([StudentLoanPlan.Plan2]),
);

calc.net;                  // annual take-home
calc.incomeTax;            // annual income tax
calc.nationalInsurance;    // annual NI
calc.pensionDeduction;     // annual pension contribution
calc.studentLoanDeduction; // annual student loan repayment
calc.effectiveTaxRate;     // total deductions as % of gross
calc.marginalTaxRate;      // tax rate on next £1

// Period-adjusted values
calc.setPeriod(Period.Monthly);
calc.displayNet;           // monthly take-home
calc.displayIncomeTax;     // monthly income tax

// Reverse calculation — find gross from target net
calc.setSalary(NetAnnual(35000));
calc.gross;                // gross needed for £35k net

Features

  • Income tax — progressive bands with Personal Allowance taper above £100k. Supports Scottish rates.
  • National Insurance — primary threshold, main and upper rates.
  • Pensions — auto-enrolment (qualifying earnings only), employer/NET pay, salary sacrifice, personal/relief at source, and NHS tiered contributions.
  • Student loans — Plans 1, 2, 4, 5 and Postgraduate, with multiple concurrent plans.
  • Tax codes — standard, K codes, BR/D0/D1, NT, 0T, and Scottish prefixes.
  • Net-to-gross — binary search reverse calculation.
  • BreakdownstaxBreakdown, niBreakdown, and studentLoanBreakdown for detailed output.

Tax years

| Year | rUK | Scotland | | ------- | --- | -------- | | 2023-24 | Yes | Yes | | 2024-25 | Yes | Yes | | 2025-26 | Yes | Yes | | 2026-27 | Yes | Yes |

Development

npm run check       # lint + typecheck + test
npm run build       # compile to dist/
npm test            # vitest
npm run test:watch  # vitest watch mode

License

LGPL-3.0-only