Nigeria's Tax Act 2025 (signed 26 June 2025, in force 1 January 2026) rewrites personal income tax from scratch. The old PITA bands — 7% to 24% from the first naira, with the Consolidated Relief Allowance — are gone. In their place: a ₦800,000 tax-free band, then 15% / 18% / 21% / 23% / 25% up the scale, a ₦840,000 minimum-wage exemption, and rent relief.
I built a free calculator for it — Nigeria PAYE Calculator 2026 — and this post is about the part I found genuinely interesting as a developer: testing a calculator whose spec is a statute.
The spec is a law, so the test cases come from the law
Most calculator bugs I found while researching weren't code bugs — they were spec bugs: published band tables that don't match the Act. One ranking calculator whose middle bands contradict the Act's Fourth Schedule (18% stopping at ₦10M instead of ₦12M). Another still applying the CRA, which the Act abolished outright.
So the testing approach: the band table goes in as data, straight from the Fourth Schedule (s.58), and every number on the page has to survive a set of hand-computed cases:
- Boundary cases: exactly ₦800,000 (last naira of the free band), ₦800,001 (first naira at 15%), ₦3,000,000 / ₦12,000,000 / ₦25,000,000 / ₦50,000,000 band edges.
- The exemption edge: ₦840,000 gross pays zero — not because of the ₦800k band, but because of the explicit minimum-wage exemption. A calculator that only implements the bands gets this wrong.
- The abolished rule: any trace of the old CRA formula (max(₦200,000, 1% of gross) + 20% of gross) is a fail.
- Cross-check against a published worked example: ₦5,000,000 gross, 8% pension, no rent relief → chargeable ₦4,600,000 → ₦618,000 tax. Matched to the naira.
18 cases, 18 passing. The harness earned its keep before publish: it caught the old-law comparison implementing CRA as ₦200,000 + 20% of gross, when the actual PITA formula is max(₦200,000, 1% of gross) + 20% of gross — identical below ₦20M/yr, wrong above it. The kind of bug no amount of staring at the code finds, because the code looks right; only the worked example disagrees.
The page also ships a side-by-side NTA-2026 vs PITA-2025 comparison ("are you better off?") — the old bands run through the same engine with the old rules, which doubles as a regression check that the two rule sets never leak into each other.
Three things I'd tell anyone building a tax/finance calculator
- Cite the schedule and section on the page, with a date. "Verified against the Nigeria Tax Act 2025, Fourth Schedule / s.58" is both a trust signal and a forcing function — it makes stale data embarrassing, which is the point.
- Test the repealed rules, not just the current ones. The most dangerous bug class is a rule that used to be true. The CRA, the old 7%-from-first-naira bands, the "18% to ₦10M" middle that one rival still shows — each needs an explicit negative test.
- Vanilla JS is enough. No framework, no backend, no build step: a band table as data, pure functions for chargeable income → tax, and the test harness as a plain list of input/expected pairs. The whole thing is auditable in one read.
Try it / steal the approach
The calculator is free, no signup: Nigeria PAYE Calculator 2026. It's one of the calculators on ToolNestCalc — Pakistan salary tax, India gratuity, Saudi end-of-service, UAE gratuity, Zakat, US tips/overtime tax, and an AI token cost tool — all built the same way: official text first, worked examples as tests, zero-error bar.
If you've built calculators against changing regulations, I'd genuinely like to hear how you test them — especially the "rule that used to be true" problem.
Top comments (0)