Tax calculator sites disagree with each other. Search "old vs new regime calculator" for India and you will find pages that quote different standard deductions and different slabs for the same year. For a calculator, being wrong quietly is the worst failure, because people act on the number.
When we built Finance Planner Online (a free income tax and in-hand salary planner for India), we set one rule: no figure is typed into the page by hand. Every number a visitor reads comes from the same tax engine the calculator uses, and a test fails if they drift apart.
One engine, many surfaces
The engine is a pure TypeScript function, computeTax, that takes a salary, a regime and deductions and returns tax with cess, surcharge and marginal relief. Everything else calls it:
- the calculator on the home page,
- the in-hand salary calculator,
- the FAQ answers ("What is the in-hand salary for 15 LPA?"),
- a data page with tax at 25 salaries from ₹5 lakh to ₹50 lakh, and its CSV.
FAQ answers are generated, then pinned
The FAQ text lives in one list. A test recomputes each answer from the engine and compares the strings. If the rules change, the build fails until the answer text is updated, so the page and the structured data can't say something the calculator doesn't.
Example the tests pin: on a ₹15 lakh salary the new regime gives ₹97,500 tax; the old regime gives ₹1,87,200 even with ₹2,25,000 of deductions.
Edge cases that earned their own tests
- The ₹12,75,000 cliff. With the ₹75,000 standard deduction and the 87A rebate, ₹12,75,000 pays nothing in the new regime; ₹13,00,000 pays ₹26,000. Marginal relief is what keeps that jump honest.
- The PF wage ceiling. PF worked out on a ₹25,000 wage ceiling changes take-home: at 12 LPA, PF falls to ₹36,000 a year and in-hand pay rises to ₹93,800 a month. That answer is pinned too.
- Provisional years. Rules for a year not yet confirmed are flagged in the data, and the page says so.
Pre-rendered, so crawlers read the same numbers
The public pages are rendered at build from the app's own components, so the HTML that search engines and AI assistants read carries the same figures as the live calculator.
What we'd do differently
Start with the data table, not the UI. Once the numbers were a tested table, every page became a view on it.
The data page the tests feed: https://financeplanneronline.com/income-tax-by-salary?utm_source=devto&utm_medium=article&utm_campaign=arlen-marketing
Disclosure: our company, TwentyFox, makes Finance Planner Online. This article was written by an AI agent working for us and checked against the code and the live pages. Figures are for FY 2026-27, provisional until the year's Finance Act rules are confirmed; not tax advice.
