How the Brazil Salário líquido (net salary) calculator is verified

Inputs

InputFieldType
Salário bruto mensalgrossMonthlynumber
Dependentesdependentsnumber

The formula

Each derived value below is computed by the Valem engine from the expression shown, in this order. Nothing else runs — there is no hidden code path.

Derived valueFieldFormula (JSONata)
INSSinss($g := grossMonthly; $b1 := (($g < $const.inssB1 ? $g : $const.inssB1)) * 0.075; $b2 := ($g > $const.inssB1 ? (($g < $const.inssB2 ? $g : $const.inssB2) - $const.inssB1) : 0) * 0.09; $b3 := ($g > $const.inssB2 ? (($g < $const.inssB3 ? $g : $const.inssB3) - $const.inssB2) : 0) * 0.12; $b4 := ($g > $const.inssB3 ? (($g < $const.inssB4 ? $g : $const.inssB4) - $const.inssB3) : 0) * 0.14; $round($b1 + $b2 + $b3 + $b4, 2))
Deduction LegaldeductionLegal$round(inss + $const.perDependent * dependents, 2)
Deductiondeduction$round(deductionLegal > $const.simplifiedDiscount ? deductionLegal : $const.simplifiedDiscount, 2)
Base IRRFirrfBase($b := grossMonthly - deduction; $round($b > 0 ? $b : 0, 2))
IRRFirrf($b := irrfBase; $t := $b <= 2428.80 ? 0 : $b <= 2826.65 ? $b * 0.075 - 182.16 : $b <= 3751.05 ? $b * 0.15 - 394.16 : $b <= 4664.68 ? $b * 0.225 - 675.49 : $b * 0.275 - 908.73; $t := $t > 0 ? $t : 0; $g := grossMonthly; $r := $g <= $const.reductionFullUpTo ? $const.reductionMax : $g <= $const.reductionEndsAt ? $const.reductionA - $const.reductionB * $g : 0; $r := $r > 0 ? $r : 0; $r := $r < $t ? $r : $t; $round($t - $r, 2))
Líquido / mêsnetMonthly$round(grossMonthly - inss - irrf, 2)

Rates and thresholds

The expressions above read these as $const. They are the figures the annual refresh replaces, so they live as data rather than being written into the formulas — which is what makes a year-on-year change a one-line diff instead of an edit to arithmetic.

ConstantValue
perDependent189.59
simplifiedDiscount607.2
inssB11621
inssB22902.84
inssB34354.27
inssB48475.55
reductionMax312.89
reductionFullUpTo5000
reductionEndsAt7350
reductionA978.62
reductionB0.133145

Test vectors (4)

Every case is executed against this model on each build, by the Java engine and independently by a JavaScript one. A mismatch of a single cent fails the build, so the page cannot ship advertising a figure the model no longer produces.

Case 1 — S1 3,000 BRL, no dependents — simplified discount wins

given grossMonthly3000
given dependents0
expect inss248.6
expect deduction607.2
expect irrfBase2392.8
expect irrf0
expect netMonthly2751.4

Case 2 — S3 15,000 BRL — INSS ceiling binds

given grossMonthly15000
given dependents0
expect inss988.09
expect irrf2944.55

Case 3 — S4 4,800 BRL — Lei 15.270/2025 reduction removes the tax entirely

given grossMonthly4800
given dependents0
expect irrf0

Case 4 — S5 6,000 BRL — inside the 5,000-7,350 taper, the reduction is partial

given grossMonthly6000
given dependents0
expect irrf385.1

Sources

Check it yourself — and reuse it

The whole model as JSON — inputs, outputs, formulas, vectors and sources in one re-runnable document.

This model is published under CC BY 4.0: use it, adapt it, build on it, with attribution. The licence covers the model — the expression of each rule and the arrangement of the catalog. The rates and thresholds are law, and nobody licenses those; the sources above are where they come from.

← Back to the Brazil Salário líquido (net salary) calculator

Built with Valem — a live, verifiable calculator you can fork and embed.