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

kenya-tax-rates

v1.0.1

Published

Kenya payroll tax calculation utilities - PAYE, SHIF, NSSF, Housing Levy and reliefs

Readme

Kenya Tax Rates

Comprehensive payroll calculation utilities for Kenya. Calculate PAYE, SHIF, NSSF, Housing Levy, and apply tax reliefs with accurate, up-to-date rates.

Features

  • PAYE Calculator - Progressive 5-band income tax (10% to 35%)
  • SHIF Calculator - 2.75% Social Health Insurance (replaced NHIF Oct 2024)
  • NSSF Calculator - Two-tier pension with auto date-based limits
  • Housing Levy - 1.5% Affordable Housing Levy
  • Tax Reliefs - Personal, insurance, pension, mortgage deductions
  • Full Payroll - Complete salary breakdown with all deductions

Installation

npm install kenya-tax-rates

Quick Start

import { calculatePayroll, getNetSalary } from 'kenya-tax-rates';

// Quick net salary calculation
const netSalary = getNetSalary(100000);
console.log(`Net Salary: KES ${netSalary}`);

// Full payroll breakdown
const payroll = calculatePayroll({
  grossSalary: 100000,
  pensionContribution: 5000, // Optional
  insurancePremium: 2000,    // Optional
});

console.log(payroll);
// {
//   grossSalary: 100000,
//   taxableIncome: 93590,
//   deductions: {
//     shif: 2750,
//     nssf: 2160,
//     housingLevy: 1500,
//     paye: 18594.70,
//     totalDeductions: 25004.70
//   },
//   netSalary: 74995.30,
//   ...
// }

Individual Calculators

import {
  calculatePaye,
  calculateShif,
  calculateNssf,
  calculateHousingLevy,
} from 'kenya-tax-rates';

// PAYE with reliefs
const paye = calculatePaye(85000);
// { grossPaye: 21283.35, personalRelief: 2400, netPaye: 18883.35, ... }

// SHIF (2.75%, min KES 300)
const shif = calculateShif(50000); // 1375

// NSSF (auto-detects 2024/2025 rates)
const nssf = calculateNssf(80000);
// { tierOne: 480, tierTwo: 3840, employeeTotal: 4320, ... }

// Housing Levy (1.5%)
const levy = calculateHousingLevy(100000); // 1500

Current Tax Rates (2024/2025)

PAYE Tax Bands (Monthly)

| Income Range (KES) | Rate | |--------------------|------| | 0 - 24,000 | 10% | | 24,001 - 32,333 | 25% | | 32,334 - 500,000 | 30% | | 500,001 - 800,000 | 32.5% | | Above 800,000 | 35% |

Statutory Deductions

| Deduction | Rate | Notes | |-----------|------|-------| | SHIF | 2.75% | Min KES 300, no cap | | NSSF | 6% | Up to UEL (see below) | | Housing Levy | 1.5% | Employee + Employer |

NSSF Limits

| Period | LEL | UEL | Max Contribution | |--------|-----|-----|------------------| | Feb 2024 - Jan 2025 | KES 7,000 | KES 36,000 | KES 2,160 | | From Feb 2025 | KES 8,000 | KES 72,000 | KES 4,320 |

Reliefs

  • Personal Relief: KES 2,400/month
  • Insurance Relief: 15% of premiums, max KES 5,000/month
  • Pension Deduction: Max KES 30,000/month
  • Mortgage Interest: Max KES 30,000/month

API Reference

calculatePayroll(input: PayrollInput): PayrollResult

Full payroll calculation with all deductions and reliefs.

getNetSalary(grossSalary: number, date?: Date): number

Quick net salary calculation.

calculatePaye(taxableIncome: number, insurancePremium?: number, shifContribution?: number): PayeResult

PAYE calculation with reliefs.

calculateShif(grossSalary: number): number

SHIF contribution (2.75%, min KES 300).

calculateNssf(pensionableEarnings: number, date?: Date): NssfResult

NSSF two-tier contribution.

calculateHousingLevy(grossSalary: number): number

Employee housing levy (1.5%).

License

MIT