The lazy way to build a multi-country payroll calculator is one generic progressive-tax formula with country-specific bracket tables plugged in. That approach breaks immediately because payroll deductions aren't just income tax — they're income tax plus a different set of mandatory contributions in every single country, and those contributions don't share a common structure.
Why one formula doesn't work
US payroll deducts federal income tax, Social Security (6.2% up to a wage base), and Medicare (1.45%, plus an additional 0.9% above a threshold for high earners). India deducts income tax under the new or old regime, Employee Provident Fund (typically 12% of basic pay), and sometimes professional tax depending on the state. Germany deducts income tax, pension insurance, health insurance, unemployment insurance, and long-term care insurance — five separate line items, each with its own rate and its own contribution ceiling. None of these map onto each other. A generic formula with swapped-in numbers would get every one of them wrong.
What we actually built: 26 country-specific functions
/payroll-calculator dispatches to one of 26 country-specific calculation functions — calcUS, calcGB, calcIN, calcDE, calcFR, calcJP, calcBR, and 19 more — each implementing that country's actual deduction structure: which contributions apply, what they're calculated against (gross vs. a capped base), and in what order they're deducted. The request takes gross_salary, country, and pay_frequency (monthly, biweekly, or weekly), and the response itemises every deduction by name with its amount, plus net pay per period and an effective tax rate.
The rest of the namespace builds on the same discipline
/statutory-benefits and /leave-policy follow the same per-country-accuracy approach for mandatory benefits and statutory leave entitlements. /salary-bands-generator, /compensation-bands, and /job-grading handle the compensation-structuring side. And a set of document generators — /hr-policy-generator, /employee-handbook-outline, /onboarding-checklist, /termination-checklist, /performance-review-template — produce real structured documents rather than blank templates, the same pattern we use in /legal's document generators.
What this is and isn't
This computes deductions correctly against each country's standard statutory structure as of our data's effective date — it's not a substitute for an actual payroll provider that handles filing, remittance, and edge cases like multi-state US employees or collective-bargaining-specific deductions in countries where those apply. For estimating take-home pay, comparing offers across countries, or building an internal HR tool, the per-country logic is the part that actually makes the numbers trustworthy.