{
  "$comment": "Machine-readable companion to https://valem.run/calculators/brazil/net-salary. Formula, inputs, outputs, engine-verified test vectors, cited sources and the re-runnable Valem ModelSpec behind the page.",
  "url": "https://valem.run/calculators/brazil/net-salary",
  "dataUrl": "https://valem.run/calculators/brazil/net-salary.json",
  "license": {
    "name": "CC BY 4.0",
    "url": "https://creativecommons.org/licenses/by/4.0/",
    "attribution": "Brazil salário líquido model by Valem (https://valem.run/calculators/brazil/net-salary), CC BY 4.0.",
    "note": "Covers the model — the expression of each rule and the arrangement of the catalog. The rates and thresholds themselves are law and are not licensed by anyone; the cited sources are where they come from."
  },
  "verificationUrl": "https://valem.run/calculators/brazil/net-salary/verify",
  "country": "brazil",
  "countryName": "Brazil",
  "formula": "net-salary",
  "formulaName": "Salário líquido",
  "title": "Calculadora Salário Líquido — Brazil net pay",
  "answer": "Your Brazilian net salary is your gross minus progressive INSS social security and monthly income tax (IRRF), after the better of the legal or simplified deduction.",
  "lang": "en",
  "currency": "BRL",
  "taxYear": "2025",
  "verification": {
    "claim": "internal-consistency",
    "statement": "The Valem engine reproduces this model's stated formula through 2 self-test cases (below, and re-runnable against the spec). That asserts internal consistency, NOT that the formula matches current law — the cited sources are the evidence for that, and carry the date each was last checked.",
    "selfTestCases": 2,
    "ratesAreIllustrative": false,
    "sourcesCheckedOn": "2026-08-02"
  },
  "sources": [
    {
      "label": "Receita Federal — IRRF",
      "url": "https://www.gov.br/receitafederal",
      "checked": "2026-08-02"
    },
    {
      "label": "INSS — tabela de contribuição",
      "url": "https://www.gov.br/inss",
      "checked": "2026-08-02"
    }
  ],
  "terminalOutput": "netMonthly",
  "inputs": [
    {
      "name": "grossMonthly",
      "type": "number",
      "label": "Salário bruto mensal (BRL)",
      "format": "currency",
      "minimum": 0
    },
    {
      "name": "dependents",
      "type": "number",
      "label": "Dependentes",
      "minimum": 0
    }
  ],
  "outputs": [
    {
      "name": "inss",
      "type": "number",
      "label": "INSS",
      "format": "currency",
      "formula": "($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))"
    },
    {
      "name": "deductionLegal",
      "type": "number",
      "formula": "$round(inss + $const.perDependent * dependents, 2)"
    },
    {
      "name": "deduction",
      "type": "number",
      "formula": "$round(deductionLegal > $const.simplifiedDiscount ? deductionLegal : $const.simplifiedDiscount, 2)"
    },
    {
      "name": "irrfBase",
      "type": "number",
      "label": "Base IRRF",
      "format": "currency",
      "formula": "($b := grossMonthly - deduction; $round($b > 0 ? $b : 0, 2))"
    },
    {
      "name": "irrf",
      "type": "number",
      "label": "IRRF",
      "format": "currency",
      "formula": "($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))"
    },
    {
      "name": "netMonthly",
      "type": "number",
      "label": "Líquido / mês",
      "format": "currency",
      "formula": "$round(grossMonthly - inss - irrf, 2)"
    }
  ],
  "testCases": [
    {
      "description": "S1 3,000 BRL, no dependents — simplified discount wins",
      "given": {
        "grossMonthly": 3000,
        "dependents": 0
      },
      "expect": {
        "inss": 253.41,
        "deduction": 564.8,
        "irrfBase": 2435.2,
        "irrf": 13.2,
        "netMonthly": 2733.39
      }
    },
    {
      "description": "S3 15,000 BRL — INSS ceiling binds",
      "given": {
        "grossMonthly": 15000,
        "dependents": 0
      },
      "expect": {
        "inss": 951.63
      }
    }
  ],
  "spec": {
    "id": "net-salary-brazil",
    "version": "1.0.0",
    "schema": {
      "type": "object",
      "properties": {
        "grossMonthly": {
          "type": "number",
          "minimum": 0
        },
        "dependents": {
          "type": "number",
          "minimum": 0
        },
        "inss": {
          "type": "number",
          "readOnly": true
        },
        "deductionLegal": {
          "type": "number",
          "readOnly": true
        },
        "deduction": {
          "type": "number",
          "readOnly": true
        },
        "irrfBase": {
          "type": "number",
          "readOnly": true
        },
        "irrf": {
          "type": "number",
          "readOnly": true
        },
        "netMonthly": {
          "type": "number",
          "readOnly": true
        }
      }
    },
    "constants": {
      "perDependent": 189.59,
      "simplifiedDiscount": 564.8,
      "inssB1": 1518,
      "inssB2": 2793.88,
      "inssB3": 4190.83,
      "inssB4": 8157.41
    },
    "defaultValues": [
      {
        "path": "$",
        "expr": "{ 'grossMonthly': 3000, 'dependents': 0 }"
      }
    ],
    "derivations": [
      {
        "path": "$.inss",
        "expr": "($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))"
      },
      {
        "path": "$.deductionLegal",
        "expr": "$round(inss + $const.perDependent * dependents, 2)"
      },
      {
        "path": "$.deduction",
        "expr": "$round(deductionLegal > $const.simplifiedDiscount ? deductionLegal : $const.simplifiedDiscount, 2)"
      },
      {
        "path": "$.irrfBase",
        "expr": "($b := grossMonthly - deduction; $round($b > 0 ? $b : 0, 2))"
      },
      {
        "path": "$.irrf",
        "expr": "($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))"
      },
      {
        "path": "$.netMonthly",
        "expr": "$round(grossMonthly - inss - irrf, 2)"
      }
    ],
    "constraints": [],
    "metaDerivations": [],
    "viewDefinition": {
      "renderer": "builtin",
      "defaultView": "main",
      "views": [
        {
          "id": "main",
          "label": "Salário líquido",
          "layout": "vertical",
          "components": [
            {
              "id": "gross",
              "type": "numericField",
              "label": "Salário bruto mensal (BRL)",
              "bind": "$.grossMonthly"
            },
            {
              "id": "dep",
              "type": "numericField",
              "label": "Dependentes",
              "bind": "$.dependents"
            },
            {
              "id": "tiles",
              "type": "group",
              "layout": "horizontal",
              "components": [
                {
                  "id": "netM",
                  "type": "statTile",
                  "label": "Líquido / mês",
                  "bind": "$.netMonthly",
                  "format": "currency",
                  "currency": "BRL"
                }
              ]
            },
            {
              "id": "sep1",
              "type": "separatorLine"
            },
            {
              "id": "breakdown",
              "type": "keyValueList",
              "label": "Detalhamento mensal",
              "items": [
                {
                  "label": "Bruto",
                  "bind": "$.grossMonthly",
                  "format": "currency",
                  "currency": "BRL"
                },
                {
                  "label": "INSS",
                  "bind": "$.inss",
                  "format": "currency",
                  "currency": "BRL"
                },
                {
                  "label": "Base IRRF",
                  "bind": "$.irrfBase",
                  "format": "currency",
                  "currency": "BRL"
                },
                {
                  "label": "IRRF",
                  "bind": "$.irrf",
                  "format": "currency",
                  "currency": "BRL"
                },
                {
                  "label": "Líquido",
                  "bind": "$.netMonthly",
                  "format": "currency",
                  "currency": "BRL"
                }
              ]
            },
            {
              "id": "note",
              "type": "staticText",
              "text": "'Brasil 2025: INSS progressivo por faixa, IRRF mensal, usando a maior dedução entre a legal (INSS + R$189,59 por dependente) e o desconto simplificado. Estimativa, não é aconselhamento fiscal.'"
            },
            {
              "id": "sources",
              "type": "sourceList",
              "label": "Fontes",
              "items": [
                {
                  "label": "Receita Federal — IRRF",
                  "url": "https://www.gov.br/receitafederal",
                  "date": "2026-08-02"
                },
                {
                  "label": "INSS — tabela de contribuição",
                  "url": "https://www.gov.br/inss",
                  "date": "2026-08-02"
                }
              ]
            }
          ]
        }
      ]
    },
    "tests": [
      {
        "description": "S1 3,000 BRL, no dependents — simplified discount wins",
        "given": {
          "$.grossMonthly": 3000,
          "$.dependents": 0
        },
        "expect": {
          "$.inss": 253.41,
          "$.deduction": 564.8,
          "$.irrfBase": 2435.2,
          "$.irrf": 13.2,
          "$.netMonthly": 2733.39
        }
      },
      {
        "description": "S3 15,000 BRL — INSS ceiling binds",
        "given": {
          "$.grossMonthly": 15000,
          "$.dependents": 0
        },
        "expect": {
          "$.inss": 951.63
        }
      }
    ]
  }
}
