{
  "$comment": "Machine-readable companion to https://valem.run/calculators/spain/self-employed. Formula, inputs, outputs, engine-verified test vectors, cited sources and the re-runnable Valem ModelSpec behind the page.",
  "url": "https://valem.run/calculators/spain/self-employed",
  "dataUrl": "https://valem.run/calculators/spain/self-employed.json",
  "license": {
    "name": "CC BY 4.0",
    "url": "https://creativecommons.org/licenses/by/4.0/",
    "attribution": "Spain autónomo model by Valem (https://valem.run/calculators/spain/self-employed), 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/self-employed/verify",
  "country": "spain",
  "countryName": "Spain",
  "formula": "self-employed",
  "formulaName": "Autónomo",
  "title": "Autónomo — Spain Freelancer Tax",
  "answer": "Your net income as a new Spanish autónomo is revenue minus a flat 88.64 EUR/month Social Security quota (unrelated to how much you earn) and a 20% IRPF advance on what remains after it.",
  "lang": "en",
  "currency": "EUR",
  "taxYear": "2026",
  "verification": {
    "claim": "shape-only",
    "statement": "The rates in this model are illustrative. Its 2 self-test cases confirm the engine reproduces the shape of the charge, but the schedule is not the official one, so the amount will not match a real bill. The cited sources name the document that would replace it.",
    "selfTestCases": 2,
    "ratesAreIllustrative": true,
    "sourcesCheckedOn": "2026-08-22"
  },
  "sources": [
    {
      "label": "Seguridad Social — Trabajadores autónomos: cuota y tarifa plana",
      "url": "https://www.seg-social.es/wps/portal/wss/internet/Trabajadores/Afiliacion/RegimenesQuienes/31190",
      "checked": "2026-08-22"
    },
    {
      "label": "MoveToSpain — Autónomo in Spain 2026: Complete Self-Employed Guide",
      "url": "https://movetospain.io/en/blog/spain-autonomo-self-employed-guide-2026",
      "checked": "2026-08-22"
    },
    {
      "label": "mallorca.com — Tarifa Plana Autónomo Spain 2026",
      "url": "https://www.mallorca.com/en/advice/relocation/work-career/flat-rate-autonomo-spain",
      "checked": "2026-08-22"
    }
  ],
  "terminalOutput": "netIncome",
  "inputs": [
    {
      "name": "annualRevenue",
      "type": "number",
      "label": "Annual revenue (EUR)",
      "minimum": 0
    }
  ],
  "outputs": [
    {
      "name": "annualQuota",
      "type": "number",
      "label": "Social Security quota (flat)",
      "format": "number",
      "formula": "$round($const.monthlyQuota * 12, 2)"
    },
    {
      "name": "taxBase",
      "type": "number",
      "formula": "$round($max([0, annualRevenue - annualQuota]), 2)"
    },
    {
      "name": "irpfAdvance",
      "type": "number",
      "label": "IRPF advance (20%)",
      "format": "number",
      "formula": "$round(taxBase * $const.irpfAdvanceRate, 2)"
    },
    {
      "name": "netIncome",
      "type": "number",
      "label": "Net income / year",
      "format": "number",
      "formula": "$round($max([0, annualRevenue - annualQuota - irpfAdvance]), 2)"
    }
  ],
  "testCases": [
    {
      "description": "30,000 EUR revenue, tarifa plana year",
      "given": {
        "annualRevenue": 30000
      },
      "expect": {
        "annualQuota": 1063.68,
        "taxBase": 28936.32,
        "irpfAdvance": 5787.26,
        "netIncome": 23149.06
      }
    },
    {
      "description": "500 EUR revenue — the flat quota alone exceeds it",
      "given": {
        "annualRevenue": 500
      },
      "expect": {
        "annualQuota": 1063.68,
        "taxBase": 0,
        "irpfAdvance": 0,
        "netIncome": 0
      }
    }
  ],
  "spec": {
    "id": "self-employed-spain",
    "version": "1.0.0",
    "schema": {
      "type": "object",
      "properties": {
        "annualRevenue": {
          "type": "number",
          "minimum": 0
        },
        "annualQuota": {
          "type": "number",
          "readOnly": true
        },
        "taxBase": {
          "type": "number",
          "readOnly": true
        },
        "irpfAdvance": {
          "type": "number",
          "readOnly": true
        },
        "netIncome": {
          "type": "number",
          "readOnly": true
        }
      },
      "required": [
        "annualRevenue"
      ]
    },
    "constants": {
      "monthlyQuota": 88.64,
      "irpfAdvanceRate": 0.2
    },
    "defaultValues": [
      {
        "path": "$",
        "expr": "{ \"annualRevenue\": 30000 }"
      }
    ],
    "derivations": [
      {
        "path": "$.annualQuota",
        "expr": "$round($const.monthlyQuota * 12, 2)"
      },
      {
        "path": "$.taxBase",
        "expr": "$round($max([0, annualRevenue - annualQuota]), 2)"
      },
      {
        "path": "$.irpfAdvance",
        "expr": "$round(taxBase * $const.irpfAdvanceRate, 2)"
      },
      {
        "path": "$.netIncome",
        "expr": "$round($max([0, annualRevenue - annualQuota - irpfAdvance]), 2)"
      }
    ],
    "constraints": [],
    "viewDefinition": {
      "renderer": "builtin",
      "defaultView": "main",
      "views": [
        {
          "id": "main",
          "label": "Self-employed net income",
          "layout": "vertical",
          "components": [
            {
              "id": "illustrativeNotice",
              "type": "alert",
              "variant": "warning",
              "label": "Illustrative rates — not the official schedule",
              "text": "'The 88.64 EUR/month tarifa plana applies only to newly-registered autónomos (not registered in the prior two years), for the first 12 months, extendable to 24 if net income stays below the minimum wage. After that, contributions switch to Spain\\u2019s income-tiered RETA table, which is substantially higher. The 20% IRPF advance (Modelo 130) is reconciled against actual tax owed at year end, not a final figure. Some regions subsidise the quota to 0 EUR. Not tax advice.'"
            },
            {
              "id": "revenueField",
              "type": "numericField",
              "label": "Annual revenue (EUR)",
              "bind": "$.annualRevenue",
              "placeholder": "30000"
            },
            {
              "id": "tiles",
              "type": "group",
              "layout": "horizontal",
              "components": [
                {
                  "id": "netTile",
                  "type": "statTile",
                  "label": "Net income / year",
                  "bind": "$.netIncome",
                  "format": "number"
                },
                {
                  "id": "quotaTile",
                  "type": "statTile",
                  "label": "Social Security quota (flat)",
                  "bind": "$.annualQuota",
                  "format": "number"
                },
                {
                  "id": "irpfTile",
                  "type": "statTile",
                  "label": "IRPF advance (20%)",
                  "bind": "$.irpfAdvance",
                  "format": "number"
                }
              ]
            },
            {
              "id": "sources",
              "type": "sourceList",
              "label": "Sources",
              "items": [
                {
                  "label": "Seguridad Social — Trabajadores autónomos: cuota y tarifa plana",
                  "url": "https://www.seg-social.es/wps/portal/wss/internet/Trabajadores/Afiliacion/RegimenesQuienes/31190",
                  "date": "2026-08-22"
                },
                {
                  "label": "MoveToSpain — Autónomo in Spain 2026: Complete Self-Employed Guide",
                  "url": "https://movetospain.io/en/blog/spain-autonomo-self-employed-guide-2026",
                  "date": "2026-08-22"
                },
                {
                  "label": "mallorca.com — Tarifa Plana Autónomo Spain 2026",
                  "url": "https://www.mallorca.com/en/advice/relocation/work-career/flat-rate-autonomo-spain",
                  "date": "2026-08-22"
                }
              ]
            }
          ]
        }
      ]
    },
    "tests": [
      {
        "description": "30,000 EUR revenue, tarifa plana year",
        "given": {
          "$.annualRevenue": 30000
        },
        "expect": {
          "$.annualQuota": 1063.68,
          "$.taxBase": 28936.32,
          "$.irpfAdvance": 5787.26,
          "$.netIncome": 23149.06
        }
      },
      {
        "description": "500 EUR revenue — the flat quota alone exceeds it",
        "given": {
          "$.annualRevenue": 500
        },
        "expect": {
          "$.annualQuota": 1063.68,
          "$.taxBase": 0,
          "$.irpfAdvance": 0,
          "$.netIncome": 0
        }
      }
    ]
  }
}
