How the Brazil salário líquido calculator is verified

Inputs

InputFieldType
Salário bruto mensal (BRL)grossMonthlynumber
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 <= 2259.20 ? 0 : $b <= 2826.65 ? $b * 0.075 - 169.44 : $b <= 3751.05 ? $b * 0.15 - 381.44 : $b <= 4664.68 ? $b * 0.225 - 662.77 : $b * 0.275 - 896.00; $round($t > 0 ? $t : 0, 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
simplifiedDiscount564.8
inssB11518
inssB22793.88
inssB34190.83
inssB48157.41

Test vectors (2)

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 inss253.41
expect deduction564.8
expect irrfBase2435.2
expect irrf13.2
expect netMonthly2733.39

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

given grossMonthly15000
given dependents0
expect inss951.63

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 calculator

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