{
  "schemaVersion": 1,
  "slug": "kd-ratio-calculator",
  "category": "gaming",
  "kind": "implementation",
  "independentValidation": false,
  "implementationHash": "e4b53dd7e4cb8483012ff65368ce66566051baf05ad2f067dc16ae79a77fab62",
  "provenance": "Generated from the calculation contract used by the published page. Publication is not external validation.",
  "sourceFiles": [
    "data/calculators/kd-ratio-calculator.json",
    "src/engine.js"
  ],
  "runtimeSource": "/sources/engine.txt",
  "runtimeHash": "5c888d8898afbdee36267bb9977829e1e2ac568f6677c8ee87469c139864645c",
  "scope": "The compute function records implemented equations, constants, lookup tables and custom rules. Inputs record defaults and allowed values; outputs record precision and units. Defaults are examples, not recommendations. General background references are not evidence for this specific algorithm.",
  "publishedFormula": {
    "formula": "K/D = K ÷ D; KDA = (K + A) ÷ D",
    "vars": [
      [
        "K/D",
        "Kill/death ratio"
      ],
      [
        "K",
        "Kills"
      ],
      [
        "D",
        "Deaths"
      ],
      [
        "A",
        "Assists"
      ],
      [
        "KDA",
        "KDA ratio"
      ]
    ],
    "note": "K/D = kills ÷ deaths; KDA = (kills + assists) ÷ deaths. Both ratios are undefined when deaths = 0."
  },
  "externalEvidence": {
    "reviewedAt": "2026-10-12",
    "sources": [
      {
        "name": "OpenStax — Ratios and rates",
        "url": "https://openstax.org/books/prealgebra-2e/pages/5-6-ratios-and-rate"
      }
    ],
    "referenceRole": "definition",
    "implementationHash": "e4b53dd7e4cb8483012ff65368ce66566051baf05ad2f067dc16ae79a77fab62",
    "basis": "K/D = K ÷ D; KDA = (K + A) ÷ D",
    "limitations": "The references explain definitions and methods; any extra preset must be checked against the assumptions on this page."
  },
  "contract": {
    "compute": "const kd = deaths > 0 ? kills/deaths : null; const kda = deaths > 0 ? (kills + assists)/deaths : null; return { kd: kd, kda: kda, killsPerMatch: matches > 0 ? kills/matches : 0, deathsPerMatch: matches > 0 ? deaths/matches : 0, assistsPerMatch: matches > 0 ? assists/matches : 0 };",
    "inputs": [
      {
        "name": "kills",
        "type": "number",
        "default": 250,
        "min": 0,
        "max": 1000000,
        "step": 1
      },
      {
        "name": "deaths",
        "type": "number",
        "default": 180,
        "min": 0,
        "max": 1000000,
        "step": 1
      },
      {
        "name": "assists",
        "type": "number",
        "default": 90,
        "min": 0,
        "max": 1000000,
        "step": 1
      },
      {
        "name": "matches",
        "type": "number",
        "default": 50,
        "min": 1,
        "max": 100000,
        "step": 1
      }
    ],
    "outputs": [
      {
        "name": "kd",
        "precision": 2,
        "unit": "",
        "optional": true
      },
      {
        "name": "kda",
        "precision": 2,
        "unit": "",
        "optional": true
      },
      {
        "name": "killsPerMatch",
        "precision": 2,
        "unit": ""
      },
      {
        "name": "deathsPerMatch",
        "precision": 2,
        "unit": ""
      },
      {
        "name": "assistsPerMatch",
        "precision": 2,
        "unit": ""
      }
    ],
    "interpret": null
  }
}
