{
  "$comment": "Machine-readable companion to https://valem.run/calculators/spain/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/spain/net-salary",
  "dataUrl": "https://valem.run/calculators/spain/net-salary.json",
  "license": {
    "name": "CC BY 4.0",
    "url": "https://creativecommons.org/licenses/by/4.0/",
    "attribution": "Spain sueldo neto model by Valem (https://valem.run/calculators/spain/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/spain/net-salary/verify",
  "country": "spain",
  "countryName": "Spain",
  "formula": "net-salary",
  "formulaName": "Sueldo neto",
  "title": "Calculadora Sueldo Neto — Spain net pay",
  "answer": "Your Spanish net salary is your gross minus social-security contributions and IRPF income tax, after the personal-minimum credit.",
  "lang": "en",
  "currency": "EUR",
  "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": "AEAT",
      "url": "https://sede.agenciatributaria.gob.es",
      "checked": "2026-08-02"
    },
    {
      "label": "Seguridad Social",
      "url": "https://www.seg-social.es",
      "checked": "2026-08-02"
    }
  ],
  "terminalOutput": "netMonthly",
  "inputs": [
    {
      "name": "grossAnnual",
      "type": "number",
      "label": "Salario bruto anual (EUR)",
      "format": "currency",
      "minimum": 0
    }
  ],
  "outputs": [
    {
      "name": "ssBase",
      "type": "number",
      "formula": "grossAnnual < $const.ssCeiling ? grossAnnual : $const.ssCeiling"
    },
    {
      "name": "ss",
      "type": "number",
      "label": "Seguridad Social",
      "format": "currency",
      "formula": "$round(ssBase * $const.ssRate, 2)"
    },
    {
      "name": "taxable",
      "type": "number",
      "label": "Base imponible",
      "format": "currency",
      "formula": "$round(grossAnnual - ss, 2)"
    },
    {
      "name": "irpef",
      "type": "number",
      "label": "IRPF",
      "format": "currency",
      "formula": "($t := taxable; $g := (($t < 12450 ? $t : 12450) * 0.19) + (($t > 12450 ? (($t < 20200 ? $t : 20200) - 12450) : 0) * 0.24) + (($t > 20200 ? (($t < 35200 ? $t : 35200) - 20200) : 0) * 0.30) + (($t > 35200 ? (($t < 60000 ? $t : 60000) - 35200) : 0) * 0.37) + (($t > 60000 ? (($t < 300000 ? $t : 300000) - 60000) : 0) * 0.45) + (($t > 300000 ? ($t - 300000) : 0) * 0.47); $x := $g - $const.personalMinCredit; $round($x > 0 ? $x : 0, 2))"
    },
    {
      "name": "netAnnual",
      "type": "number",
      "label": "Neto / año",
      "format": "currency",
      "formula": "$round(grossAnnual - ss - irpef, 2)"
    },
    {
      "name": "netMonthly",
      "type": "number",
      "label": "Neto / mes (14 pagas)",
      "format": "currency",
      "formula": "$round(netAnnual / 14, 2)"
    }
  ],
  "testCases": [
    {
      "description": "S1 25,000 EUR single (Madrid scale)",
      "given": {
        "grossAnnual": 25000
      },
      "expect": {
        "ss": 1620,
        "taxable": 23380,
        "irpef": 4125,
        "netAnnual": 19255
      }
    },
    {
      "description": "S3 70,000 EUR — SS base capped",
      "given": {
        "grossAnnual": 70000
      },
      "expect": {
        "ssBase": 58914,
        "ss": 3817.63,
        "taxable": 66182.37
      }
    }
  ],
  "spec": {
    "id": "net-salary-spain",
    "version": "1.0.0",
    "schema": {
      "type": "object",
      "properties": {
        "grossAnnual": {
          "type": "number",
          "minimum": 0
        },
        "ssBase": {
          "type": "number",
          "readOnly": true
        },
        "ss": {
          "type": "number",
          "readOnly": true
        },
        "taxable": {
          "type": "number",
          "readOnly": true
        },
        "irpef": {
          "type": "number",
          "readOnly": true
        },
        "netAnnual": {
          "type": "number",
          "readOnly": true
        },
        "netMonthly": {
          "type": "number",
          "readOnly": true
        }
      }
    },
    "constants": {
      "ssRate": 0.0648,
      "ssCeiling": 58914,
      "personalMinCredit": 1054.5
    },
    "defaultValues": [
      {
        "path": "$",
        "expr": "{ 'grossAnnual': 25000 }"
      }
    ],
    "derivations": [
      {
        "path": "$.ssBase",
        "expr": "grossAnnual < $const.ssCeiling ? grossAnnual : $const.ssCeiling"
      },
      {
        "path": "$.ss",
        "expr": "$round(ssBase * $const.ssRate, 2)"
      },
      {
        "path": "$.taxable",
        "expr": "$round(grossAnnual - ss, 2)"
      },
      {
        "path": "$.irpef",
        "expr": "($t := taxable; $g := (($t < 12450 ? $t : 12450) * 0.19) + (($t > 12450 ? (($t < 20200 ? $t : 20200) - 12450) : 0) * 0.24) + (($t > 20200 ? (($t < 35200 ? $t : 35200) - 20200) : 0) * 0.30) + (($t > 35200 ? (($t < 60000 ? $t : 60000) - 35200) : 0) * 0.37) + (($t > 60000 ? (($t < 300000 ? $t : 300000) - 60000) : 0) * 0.45) + (($t > 300000 ? ($t - 300000) : 0) * 0.47); $x := $g - $const.personalMinCredit; $round($x > 0 ? $x : 0, 2))"
      },
      {
        "path": "$.netAnnual",
        "expr": "$round(grossAnnual - ss - irpef, 2)"
      },
      {
        "path": "$.netMonthly",
        "expr": "$round(netAnnual / 14, 2)"
      }
    ],
    "constraints": [],
    "metaDerivations": [],
    "viewDefinition": {
      "renderer": "builtin",
      "defaultView": "main",
      "views": [
        {
          "id": "main",
          "label": "Sueldo neto",
          "layout": "vertical",
          "components": [
            {
              "id": "gross",
              "type": "numericField",
              "label": "Salario bruto anual (EUR)",
              "bind": "$.grossAnnual"
            },
            {
              "id": "tiles",
              "type": "group",
              "layout": "horizontal",
              "components": [
                {
                  "id": "netM",
                  "type": "statTile",
                  "label": "Neto / mes (14 pagas)",
                  "bind": "$.netMonthly",
                  "format": "currency",
                  "currency": "EUR"
                },
                {
                  "id": "netY",
                  "type": "statTile",
                  "label": "Neto / año",
                  "bind": "$.netAnnual",
                  "format": "currency",
                  "currency": "EUR"
                }
              ]
            },
            {
              "id": "sep1",
              "type": "separatorLine"
            },
            {
              "id": "breakdown",
              "type": "keyValueList",
              "label": "Desglose anual",
              "items": [
                {
                  "label": "Bruto",
                  "bind": "$.grossAnnual",
                  "format": "currency",
                  "currency": "EUR"
                },
                {
                  "label": "Seguridad Social",
                  "bind": "$.ss",
                  "format": "currency",
                  "currency": "EUR"
                },
                {
                  "label": "Base imponible",
                  "bind": "$.taxable",
                  "format": "currency",
                  "currency": "EUR"
                },
                {
                  "label": "IRPF",
                  "bind": "$.irpef",
                  "format": "currency",
                  "currency": "EUR"
                },
                {
                  "label": "Neto",
                  "bind": "$.netAnnual",
                  "format": "currency",
                  "currency": "EUR"
                }
              ]
            },
            {
              "id": "note",
              "type": "staticText",
              "text": "'España 2025: Seguridad Social del empleado ~6,47% sobre base tope, IRPF estatal+autonómico 19-47%, menos el mínimo personal. Estimación, no es asesoramiento fiscal.'"
            },
            {
              "id": "sources",
              "type": "sourceList",
              "label": "Fuentes",
              "items": [
                {
                  "label": "AEAT",
                  "url": "https://sede.agenciatributaria.gob.es",
                  "date": "2026-08-02"
                },
                {
                  "label": "Seguridad Social",
                  "url": "https://www.seg-social.es",
                  "date": "2026-08-02"
                }
              ]
            }
          ]
        }
      ]
    },
    "tests": [
      {
        "description": "S1 25,000 EUR single (Madrid scale)",
        "given": {
          "$.grossAnnual": 25000
        },
        "expect": {
          "$.ss": 1620,
          "$.taxable": 23380,
          "$.irpef": 4125,
          "$.netAnnual": 19255
        }
      },
      {
        "description": "S3 70,000 EUR — SS base capped",
        "given": {
          "$.grossAnnual": 70000
        },
        "expect": {
          "$.ssBase": 58914,
          "$.ss": 3817.63,
          "$.taxable": 66182.37
        }
      }
    ]
  }
}
