{
  "$comment": "Machine-readable companion to https://valem.run/calculators/new-zealand/car-tax. Formula, inputs, outputs, engine-verified test vectors, cited sources and the re-runnable Valem ModelSpec behind the page.",
  "url": "https://valem.run/calculators/new-zealand/car-tax",
  "dataUrl": "https://valem.run/calculators/new-zealand/car-tax.json",
  "license": {
    "name": "CC BY 4.0",
    "url": "https://creativecommons.org/licenses/by/4.0/",
    "attribution": "New Zealand rego & ruc model by Valem (https://valem.run/calculators/new-zealand/car-tax), 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/new-zealand/car-tax/verify",
  "country": "new-zealand",
  "countryName": "New Zealand",
  "formula": "car-tax",
  "formulaName": "Rego & RUC",
  "title": "Rego & RUC Calculator — New Zealand",
  "answer": "New Zealand vehicle cost is the annual licence (rego) plus Road User Charges (RUC) for diesel and electric vehicles by distance.",
  "lang": "en",
  "currency": "NZD",
  "taxYear": "2026",
  "verification": {
    "claim": "internal-consistency",
    "statement": "The Valem engine reproduces this model's stated formula through 4 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": 4,
    "ratesAreIllustrative": false,
    "sourcesCheckedOn": "2026-08-02"
  },
  "sources": [
    {
      "label": "NZTA — rego & RUC",
      "url": "https://www.nzta.govt.nz",
      "checked": "2026-08-02"
    }
  ],
  "terminalOutput": "total",
  "inputs": [
    {
      "name": "fuel",
      "type": "string",
      "label": "Fuel type"
    },
    {
      "name": "km",
      "type": "number",
      "label": "Annual distance (km)",
      "minimum": 0
    }
  ],
  "outputs": [
    {
      "name": "rucRate",
      "type": "number",
      "label": "RUC rate per 1,000 km",
      "formula": "($f := fuel; $f = 'diesel' or $f = 'ev' ? $const.rucPer1000 : $f = 'phev' ? $const.rucPhevPer1000 : 0)"
    },
    {
      "name": "ruc",
      "type": "number",
      "label": "Road User Charges",
      "format": "currency",
      "formula": "$round(km / 1000 * rucRate, 2)"
    },
    {
      "name": "total",
      "type": "number",
      "label": "Annual total",
      "format": "currency",
      "formula": "$round($const.rego + ruc, 2)"
    }
  ],
  "testCases": [
    {
      "description": "C1 petrol car — licence only, no RUC",
      "given": {
        "fuel": "petrol",
        "km": 0
      },
      "expect": {
        "rucRate": 0,
        "ruc": 0,
        "total": 107
      }
    },
    {
      "description": "C2 diesel, 12,000 km — RUC plus licence",
      "given": {
        "fuel": "diesel",
        "km": 12000
      },
      "expect": {
        "rucRate": 76,
        "ruc": 912,
        "total": 1019
      }
    },
    {
      "description": "C3 electric, 12,000 km — same RUC as diesel since 1 July 2026",
      "given": {
        "fuel": "ev",
        "km": 12000
      },
      "expect": {
        "ruc": 912,
        "total": 1019
      }
    },
    {
      "description": "C4 plug-in hybrid, 12,000 km — half the RUC rate",
      "given": {
        "fuel": "phev",
        "km": 12000
      },
      "expect": {
        "rucRate": 38,
        "ruc": 456,
        "total": 563
      }
    }
  ],
  "spec": {
    "id": "car-tax-new-zealand",
    "version": "1.0.0",
    "schema": {
      "type": "object",
      "properties": {
        "fuel": {
          "type": "string"
        },
        "km": {
          "type": "number",
          "minimum": 0
        },
        "rucRate": {
          "type": "number",
          "readOnly": true
        },
        "ruc": {
          "type": "number",
          "readOnly": true
        },
        "total": {
          "type": "number",
          "readOnly": true
        }
      }
    },
    "constants": {
      "rego": 107,
      "rucPer1000": 76,
      "rucPhevPer1000": 38
    },
    "defaultValues": [
      {
        "path": "$",
        "expr": "{ 'fuel': 'petrol', 'km': 0 }"
      }
    ],
    "derivations": [
      {
        "path": "$.rucRate",
        "expr": "($f := fuel; $f = 'diesel' or $f = 'ev' ? $const.rucPer1000 : $f = 'phev' ? $const.rucPhevPer1000 : 0)"
      },
      {
        "path": "$.ruc",
        "expr": "$round(km / 1000 * rucRate, 2)"
      },
      {
        "path": "$.total",
        "expr": "$round($const.rego + ruc, 2)"
      }
    ],
    "constraints": [],
    "metaDerivations": [],
    "viewDefinition": {
      "renderer": "builtin",
      "defaultView": "main",
      "views": [
        {
          "id": "main",
          "label": "Rego & RUC",
          "layout": "vertical",
          "components": [
            {
              "id": "fuel",
              "type": "selectField",
              "label": "Fuel type",
              "bind": "$.fuel",
              "helperText": "Diesel and electric vehicles pay Road User Charges; plug-in hybrids pay half.",
              "options": [
                {
                  "value": "petrol",
                  "label": "Petrol — no RUC (tax is in the fuel price)"
                },
                {
                  "value": "diesel",
                  "label": "Diesel — 76 NZD per 1,000 km"
                },
                {
                  "value": "ev",
                  "label": "Electric — 76 NZD per 1,000 km (RUC began 1 July 2026)"
                },
                {
                  "value": "phev",
                  "label": "Plug-in hybrid — 38 NZD per 1,000 km"
                }
              ]
            },
            {
              "id": "km",
              "type": "numericField",
              "label": "Annual distance (km)",
              "bind": "$.km"
            },
            {
              "id": "tiles",
              "type": "group",
              "layout": "horizontal",
              "components": [
                {
                  "id": "totalTile",
                  "type": "statTile",
                  "label": "Annual total",
                  "bind": "$.total",
                  "format": "currency",
                  "currency": "NZD"
                }
              ]
            },
            {
              "id": "breakdown",
              "type": "keyValueList",
              "label": "Breakdown",
              "items": [
                {
                  "label": "RUC rate per 1,000 km",
                  "bind": "$.rucRate"
                },
                {
                  "label": "Road User Charges",
                  "bind": "$.ruc",
                  "format": "currency",
                  "currency": "NZD"
                },
                {
                  "label": "Total (incl. licence)",
                  "bind": "$.total",
                  "format": "currency",
                  "currency": "NZD"
                }
              ]
            },
            {
              "id": "note",
              "type": "staticText",
              "text": "'New Zealand: annual vehicle licence (rego, ~107 NZD petrol) plus Road User Charges (RUC) for diesel and electric vehicles at 76 NZD per 1,000 km. Estimate, not advice. Plug-in hybrids pay half the rate (38 NZD per 1,000 km), and RUC for light electric vehicles began on 1 July 2026, ending their exemption. Each RUC purchase also carries a 12.44 NZD admin fee online.'"
            },
            {
              "id": "sources",
              "type": "sourceList",
              "label": "Sources",
              "items": [
                {
                  "label": "NZTA — rego & RUC",
                  "url": "https://www.nzta.govt.nz",
                  "date": "2026-08-02"
                }
              ]
            }
          ]
        }
      ]
    },
    "tests": [
      {
        "description": "C1 petrol car — licence only, no RUC",
        "given": {
          "$.fuel": "petrol",
          "$.km": 0
        },
        "expect": {
          "$.rucRate": 0,
          "$.ruc": 0,
          "$.total": 107
        }
      },
      {
        "description": "C2 diesel, 12,000 km — RUC plus licence",
        "given": {
          "$.fuel": "diesel",
          "$.km": 12000
        },
        "expect": {
          "$.rucRate": 76,
          "$.ruc": 912,
          "$.total": 1019
        }
      },
      {
        "description": "C3 electric, 12,000 km — same RUC as diesel since 1 July 2026",
        "given": {
          "$.fuel": "ev",
          "$.km": 12000
        },
        "expect": {
          "$.ruc": 912,
          "$.total": 1019
        }
      },
      {
        "description": "C4 plug-in hybrid, 12,000 km — half the RUC rate",
        "given": {
          "$.fuel": "phev",
          "$.km": 12000
        },
        "expect": {
          "$.rucRate": 38,
          "$.ruc": 456,
          "$.total": 563
        }
      }
    ]
  }
}
