{
  "id": "kd",
  "version": "b4090aab9b75",
  "status": "published",
  "name": "KD Calculator",
  "question": "What is my KD ratio?",
  "summary": "Works out your kill–death ratio (K/D) and KDA from kills, deaths and assists, and how many kills in a row you need to reach a target K/D.",
  "category": "game",
  "subcategory": "video-games",
  "url": "https://www.acalculator.org/game/kd-calculator",
  "markdown": "https://www.acalculator.org/game/kd-calculator.md",
  "kind": "function",
  "method": "K/D = kills ÷ deaths; KDA = (kills + assists) ÷ deaths; zero deaths count as 1. Kills needed = the smallest whole n ≥ 0 with (kills + n) ÷ deaths ≥ target.",
  "assumptions": [
    "Zero deaths count as one death, as most game scoreboards show it, so the K/D is the kill count.",
    "The kills needed assume no more deaths along the way.",
    "KDA here adds assists in full. Some games count an assist as half a kill."
  ],
  "inputs": {
    "$schema": "https://json-schema.org/draft/2020-12/schema",
    "type": "object",
    "properties": {
      "k": {
        "title": "Kills",
        "description": "The opponents you defeated.",
        "type": "integer",
        "minimum": 0,
        "maximum": 1000000000
      },
      "d": {
        "title": "Deaths",
        "description": "The times you were defeated.",
        "type": "integer",
        "minimum": 0,
        "maximum": 1000000000
      },
      "a": {
        "title": "Assists",
        "description": "Optional: the kills you helped a teammate make.",
        "type": "integer",
        "minimum": 0,
        "maximum": 1000000000
      },
      "t": {
        "title": "Target K/D",
        "description": "Optional: the K/D you want to reach.",
        "type": "number",
        "exclusiveMinimum": 0,
        "maximum": 1000000
      }
    }
  },
  "outputs": {
    "kd": {
      "label": "K/D ratio",
      "description": "Kills ÷ deaths (zero deaths count as 1).",
      "format": "number"
    },
    "kda": {
      "label": "KDA",
      "description": "(Kills + assists) ÷ deaths (zero deaths count as 1).",
      "format": "number"
    },
    "needed": {
      "label": "Kills in a row to reach the target",
      "description": "The fewest more kills, with no more deaths, that bring the K/D to the target or above; 0 when you are there.",
      "format": "integer"
    }
  },
  "defaultAnswer": {
    "inputs": {
      "k": 1250,
      "d": 1000,
      "t": 1.5
    },
    "outputs": {
      "kd": 1.25,
      "needed": 250
    },
    "text": "1,250 kills and 1,000 deaths is a K/D of 1.25."
  },
  "examples": [
    {
      "given": {
        "k": 16,
        "d": 4
      },
      "expect": {
        "kd": 4
      },
      "source": "Wikipedia, Glossary of video game terms: kill–death ratio (K/D), the opponents a player defeated ÷ the times the player died; 16 kills for 4 deaths is a K/D of 4, https://en.wikipedia.org/wiki/Glossary_of_video_game_terms#kill%E2%80%93death_ratio (retrieved 2026-10-05); hand calculation in content.mdx: 16 ÷ 4"
    },
    {
      "given": {
        "k": 1250,
        "d": 1000,
        "a": 300,
        "t": 1.5
      },
      "expect": {
        "kd": 1.25,
        "kda": 1.55,
        "needed": 250
      },
      "source": "hand calculation in content.mdx: 1,250 ÷ 1,000; 1,550 ÷ 1,000; 1.5 × 1,000 − 1,250; Wikipedia, Glossary of video game terms: kill–death ratio (K/D), the opponents a player defeated ÷ the times the player died; 16 kills for 4 deaths is a K/D of 4, https://en.wikipedia.org/wiki/Glossary_of_video_game_terms#kill%E2%80%93death_ratio (retrieved 2026-10-05)"
    },
    {
      "given": {
        "k": 7,
        "d": 0,
        "t": 2
      },
      "expect": {
        "kd": 7,
        "needed": 0
      },
      "source": "hand calculation in content.mdx: 7 ÷ 1; Wikipedia, Glossary of video game terms: kill–death ratio (K/D), the opponents a player defeated ÷ the times the player died; 16 kills for 4 deaths is a K/D of 4, https://en.wikipedia.org/wiki/Glossary_of_video_game_terms#kill%E2%80%93death_ratio (retrieved 2026-10-05)"
    },
    {
      "given": {
        "k": 100,
        "d": 3,
        "t": 33.5
      },
      "expect": {
        "kd": 33.333333333333336,
        "needed": 1
      },
      "source": "hand calculation in content.mdx: 33.5 × 3 = 100.5, so 101 kills: 1 more"
    }
  ],
  "sources": [
    "Wikipedia, Glossary of video game terms: kill–death ratio (K/D), with the example 16 kills for 4 deaths = 4. https://en.wikipedia.org/wiki/Glossary_of_video_game_terms#kill%E2%80%93death_ratio (retrieved 2026-10-05)"
  ],
  "related": [
    "edpi",
    "win-percentage",
    "chess-rating"
  ],
  "changelog": []
}
