{
  "$comment": "Machine-readable companion to https://valem.run/calculators/portugal/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/portugal/net-salary",
  "dataUrl": "https://valem.run/calculators/portugal/net-salary.json",
  "license": {
    "name": "CC BY 4.0",
    "url": "https://creativecommons.org/licenses/by/4.0/",
    "attribution": "Portugal salário líquido model by Valem (https://valem.run/calculators/portugal/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/portugal/net-salary/verify",
  "country": "portugal",
  "countryName": "Portugal",
  "formula": "net-salary",
  "formulaName": "Salário líquido",
  "title": "Calculadora Salário Líquido — Portugal",
  "answer": "Your Portuguese net salary is gross minus 11% social security and IRS income tax on the progressive scale after the specific deduction.",
  "lang": "en",
  "currency": "EUR",
  "taxYear": "2026",
  "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": "Portal das Finanças",
      "url": "https://www.portaldasfinancas.gov.pt",
      "checked": "2026-08-02"
    },
    {
      "label": "Segurança Social",
      "url": "https://www.seg-social.pt",
      "checked": "2026-08-02"
    }
  ],
  "terminalOutput": "netMonthly",
  "inputs": [
    {
      "name": "grossAnnual",
      "type": "number",
      "label": "Salário bruto anual (EUR)",
      "format": "currency",
      "minimum": 0
    }
  ],
  "outputs": [
    {
      "name": "ss",
      "type": "number",
      "label": "Segurança Social (11%)",
      "format": "currency",
      "formula": "$round(grossAnnual * $const.ssRate, 2)"
    },
    {
      "name": "deduction",
      "type": "number",
      "formula": "ss > $const.specificDeduction ? ss : $const.specificDeduction"
    },
    {
      "name": "taxable",
      "type": "number",
      "label": "Rendimento coletável",
      "format": "currency",
      "formula": "($b := grossAnnual - deduction; $round($b > 0 ? $b : 0, 2))"
    },
    {
      "name": "irs",
      "type": "number",
      "label": "IRS",
      "format": "currency",
      "formula": "($t := taxable; $round((($t < 8342 ? $t : 8342) * 0.125) + (($t > 8342 ? (($t < 12587 ? $t : 12587) - 8342) : 0) * 0.157) + (($t > 12587 ? (($t < 17838 ? $t : 17838) - 12587) : 0) * 0.212) + (($t > 17838 ? (($t < 23089 ? $t : 23089) - 17838) : 0) * 0.241) + (($t > 23089 ? (($t < 29397 ? $t : 29397) - 23089) : 0) * 0.311) + (($t > 29397 ? (($t < 43090 ? $t : 43090) - 29397) : 0) * 0.349) + (($t > 43090 ? (($t < 46566 ? $t : 46566) - 43090) : 0) * 0.431) + (($t > 46566 ? (($t < 86634 ? $t : 86634) - 46566) : 0) * 0.446) + (($t > 86634 ? ($t - 86634) : 0) * 0.48), 2))"
    },
    {
      "name": "netAnnual",
      "type": "number",
      "label": "Líquido / ano",
      "format": "currency",
      "formula": "$round(grossAnnual - ss - irs, 2)"
    },
    {
      "name": "netMonthly",
      "type": "number",
      "label": "Líquido / mês (14)",
      "format": "currency",
      "formula": "$round(netAnnual / 14, 2)"
    }
  ],
  "testCases": [
    {
      "description": "S1 21,000 EUR (1,500 x 14) single",
      "given": {
        "grossAnnual": 21000
      },
      "expect": {
        "ss": 2310,
        "deduction": 4587.09,
        "taxable": 16412.91,
        "irs": 2520.31
      }
    },
    {
      "description": "S3 60,000 EUR single",
      "given": {
        "grossAnnual": 60000
      },
      "expect": {
        "ss": 6600,
        "deduction": 6600,
        "taxable": 53400,
        "irs": 15374.68
      }
    }
  ],
  "spec": {
    "id": "net-salary-portugal",
    "version": "1.0.0",
    "schema": {
      "type": "object",
      "properties": {
        "grossAnnual": {
          "type": "number",
          "minimum": 0
        },
        "ss": {
          "type": "number",
          "readOnly": true
        },
        "deduction": {
          "type": "number",
          "readOnly": true
        },
        "taxable": {
          "type": "number",
          "readOnly": true
        },
        "irs": {
          "type": "number",
          "readOnly": true
        },
        "netAnnual": {
          "type": "number",
          "readOnly": true
        },
        "netMonthly": {
          "type": "number",
          "readOnly": true
        }
      }
    },
    "constants": {
      "ssRate": 0.11,
      "specificDeduction": 4587.09
    },
    "defaultValues": [
      {
        "path": "$",
        "expr": "{ 'grossAnnual': 21000 }"
      }
    ],
    "derivations": [
      {
        "path": "$.ss",
        "expr": "$round(grossAnnual * $const.ssRate, 2)"
      },
      {
        "path": "$.deduction",
        "expr": "ss > $const.specificDeduction ? ss : $const.specificDeduction"
      },
      {
        "path": "$.taxable",
        "expr": "($b := grossAnnual - deduction; $round($b > 0 ? $b : 0, 2))"
      },
      {
        "path": "$.irs",
        "expr": "($t := taxable; $round((($t < 8342 ? $t : 8342) * 0.125) + (($t > 8342 ? (($t < 12587 ? $t : 12587) - 8342) : 0) * 0.157) + (($t > 12587 ? (($t < 17838 ? $t : 17838) - 12587) : 0) * 0.212) + (($t > 17838 ? (($t < 23089 ? $t : 23089) - 17838) : 0) * 0.241) + (($t > 23089 ? (($t < 29397 ? $t : 29397) - 23089) : 0) * 0.311) + (($t > 29397 ? (($t < 43090 ? $t : 43090) - 29397) : 0) * 0.349) + (($t > 43090 ? (($t < 46566 ? $t : 46566) - 43090) : 0) * 0.431) + (($t > 46566 ? (($t < 86634 ? $t : 86634) - 46566) : 0) * 0.446) + (($t > 86634 ? ($t - 86634) : 0) * 0.48), 2))"
      },
      {
        "path": "$.netAnnual",
        "expr": "$round(grossAnnual - ss - irs, 2)"
      },
      {
        "path": "$.netMonthly",
        "expr": "$round(netAnnual / 14, 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 anual (EUR)",
              "bind": "$.grossAnnual"
            },
            {
              "id": "tiles",
              "type": "group",
              "layout": "horizontal",
              "components": [
                {
                  "id": "netM",
                  "type": "statTile",
                  "label": "Líquido / mês (14)",
                  "bind": "$.netMonthly",
                  "format": "currency",
                  "currency": "EUR"
                },
                {
                  "id": "netY",
                  "type": "statTile",
                  "label": "Líquido / ano",
                  "bind": "$.netAnnual",
                  "format": "currency",
                  "currency": "EUR"
                }
              ]
            },
            {
              "id": "breakdown",
              "type": "keyValueList",
              "label": "Detalhe anual",
              "items": [
                {
                  "label": "Bruto",
                  "bind": "$.grossAnnual",
                  "format": "currency",
                  "currency": "EUR"
                },
                {
                  "label": "Segurança Social (11%)",
                  "bind": "$.ss",
                  "format": "currency",
                  "currency": "EUR"
                },
                {
                  "label": "Rendimento coletável",
                  "bind": "$.taxable",
                  "format": "currency",
                  "currency": "EUR"
                },
                {
                  "label": "IRS",
                  "bind": "$.irs",
                  "format": "currency",
                  "currency": "EUR"
                },
                {
                  "label": "Líquido",
                  "bind": "$.netAnnual",
                  "format": "currency",
                  "currency": "EUR"
                }
              ]
            },
            {
              "id": "note",
              "type": "staticText",
              "text": "'Portugal 2026 (continente, 14 meses): Segurança Social 11%, IRS por escalões 12,5-48% após dedução específica (8,54 x IAS = 4.587,09 EUR). Estimativa, não é aconselhamento fiscal.'"
            },
            {
              "id": "sources",
              "type": "sourceList",
              "label": "Fontes",
              "items": [
                {
                  "label": "Portal das Finanças",
                  "url": "https://www.portaldasfinancas.gov.pt",
                  "date": "2026-08-02"
                },
                {
                  "label": "Segurança Social",
                  "url": "https://www.seg-social.pt",
                  "date": "2026-08-02"
                }
              ]
            }
          ]
        }
      ]
    },
    "tests": [
      {
        "description": "S1 21,000 EUR (1,500 x 14) single",
        "given": {
          "$.grossAnnual": 21000
        },
        "expect": {
          "$.ss": 2310,
          "$.deduction": 4587.09,
          "$.taxable": 16412.91,
          "$.irs": 2520.31
        }
      },
      {
        "description": "S3 60,000 EUR single",
        "given": {
          "$.grossAnnual": 60000
        },
        "expect": {
          "$.ss": 6600,
          "$.deduction": 6600,
          "$.taxable": 53400,
          "$.irs": 15374.68
        }
      }
    ]
  }
}
