{
  "id": "whip",
  "version": "ae485dd1b695",
  "status": "published",
  "name": "WHIP Calculator",
  "question": "What is my WHIP?",
  "summary": "Computes a pitcher’s WHIP, the walks plus hits allowed per inning pitched, from walks, hits and innings pitched in box-score notation (6.2 is 6⅔ innings).",
  "category": "sports",
  "subcategory": "scoring",
  "url": "https://www.acalculator.org/sports/whip-calculator",
  "markdown": "https://www.acalculator.org/sports/whip-calculator.md",
  "kind": "function",
  "method": "WHIP = (walks + hits) ÷ innings pitched, with innings pitched in thirds (outs ÷ 3), so 6.2 is 20 outs, 6⅔ innings.",
  "assumptions": [
    "Innings pitched use box-score notation: the digit after the point counts outs (.1 is one out, .2 is two outs). Any other decimal has no answer.",
    "Only walks and hits count. Hit batters, errors and fielder’s choices are left out, as in the MLB definition.",
    "With walks or hits but no outs recorded the WHIP is infinite, and with no outs and no baserunners there is none; both give no answer.",
    "The WHIP is shown to two decimal places, rounded half up from the exact fraction."
  ],
  "inputs": {
    "$schema": "https://json-schema.org/draft/2020-12/schema",
    "type": "object",
    "properties": {
      "bb": {
        "title": "Walks",
        "description": "The walks (bases on balls) the pitcher allowed, intentional walks included.",
        "type": "integer",
        "minimum": 0,
        "maximum": 100000
      },
      "h": {
        "title": "Hits",
        "description": "The hits the pitcher allowed.",
        "type": "integer",
        "minimum": 0,
        "maximum": 100000
      },
      "ip": {
        "title": "Innings pitched",
        "description": "The innings pitched in box-score notation: .1 is one out and .2 is two outs, so 6.2 means 6⅔ innings.",
        "type": "number",
        "minimum": 0,
        "maximum": 100000
      }
    }
  },
  "outputs": {
    "whip": {
      "label": "WHIP",
      "description": "Walks plus hits per inning pitched: (walks + hits) ÷ innings pitched, written with exactly two decimals (1.00).",
      "format": "text"
    },
    "baserunners": {
      "label": "Walks plus hits",
      "description": "The baserunners allowed by walks and hits.",
      "format": "integer"
    },
    "innings": {
      "label": "Innings pitched",
      "description": "The innings pitched with the partial inning as a fraction, for example 6⅔.",
      "format": "text"
    },
    "outs": {
      "label": "Outs recorded",
      "description": "The innings pitched counted in outs: 3 per whole inning plus the partial outs.",
      "format": "integer"
    },
    "perNine": {
      "label": "Walks plus hits per 9 innings",
      "description": "WHIP × 9: the baserunners allowed by walks and hits in a 9-inning game.",
      "format": "number"
    }
  },
  "defaultAnswer": {
    "inputs": {
      "bb": 40,
      "h": 150,
      "ip": 180.1
    },
    "outputs": {
      "whip": "1.05",
      "baserunners": 190,
      "innings": "180⅓",
      "outs": 541,
      "perNine": 9.482439926062847
    },
    "text": "The WHIP is 1.05 (190 walks plus hits in 180⅓ innings)."
  },
  "examples": [
    {
      "given": {
        "bb": 50,
        "h": 150,
        "ip": 200
      },
      "expect": {
        "whip": "1.00",
        "baserunners": 200,
        "innings": "200",
        "outs": 600,
        "perNine": 9
      },
      "source": "hand calculation in content.mdx: (50 + 150) ÷ 200 = 1; Python 3: Fraction(50 + 150, 200); MLB.com glossary, Walks and hits per inning pitched (WHIP): WHIP = (walks + hits) ÷ innings pitched. https://www.mlb.com/glossary/standard-stats/walks-and-hits-per-inning-pitched"
    },
    {
      "given": {
        "bb": 40,
        "h": 150,
        "ip": 180.1
      },
      "expect": {
        "whip": "1.05",
        "innings": "180⅓",
        "outs": 541,
        "perNine": 9.482439926062847
      },
      "source": "hand calculation in content.mdx: 180.1 is 541 outs; 190 × 3 ÷ 541 = 570/541 = 1.0536; × 9 = 5130/541; Python 3: Fraction(190 * 3, 541), float(Fraction(190 * 27, 541)); MLB.com glossary, Walks and hits per inning pitched (WHIP): WHIP = (walks + hits) ÷ innings pitched. https://www.mlb.com/glossary/standard-stats/walks-and-hits-per-inning-pitched"
    },
    {
      "given": {
        "bb": 1,
        "h": 2,
        "ip": 6.2
      },
      "expect": {
        "whip": "0.45",
        "innings": "6⅔",
        "outs": 20
      },
      "source": "hand calculation in content.mdx: 3 × 3 ÷ 20 = 9/20 = 0.45; MLB.com glossary, Walks and hits per inning pitched (WHIP): WHIP = (walks + hits) ÷ innings pitched. https://www.mlb.com/glossary/standard-stats/walks-and-hits-per-inning-pitched"
    },
    {
      "given": {
        "bb": 1,
        "h": 0,
        "ip": 8
      },
      "expect": {
        "whip": "0.13",
        "perNine": 1.125
      },
      "source": "hand calculation in content.mdx: 1 × 3 ÷ 24 = 1/8 = 0.125, rounded half up to 0.13; MLB.com glossary, Walks and hits per inning pitched (WHIP): WHIP = (walks + hits) ÷ innings pitched. https://www.mlb.com/glossary/standard-stats/walks-and-hits-per-inning-pitched"
    },
    {
      "given": {
        "bb": 0,
        "h": 0,
        "ip": 0.1
      },
      "expect": {
        "whip": "0.00",
        "innings": "⅓",
        "outs": 1
      },
      "source": "hand calculation in content.mdx: 0 ÷ ⅓ = 0; MLB.com glossary, Walks and hits per inning pitched (WHIP): WHIP = (walks + hits) ÷ innings pitched. https://www.mlb.com/glossary/standard-stats/walks-and-hits-per-inning-pitched"
    }
  ],
  "sources": [
    "MLB.com glossary, Walks and hits per inning pitched (WHIP): the sum of a pitcher’s walks and hits divided by the innings pitched. https://www.mlb.com/glossary/standard-stats/walks-and-hits-per-inning-pitched (retrieved 2026-10-19)",
    "Baseball-Reference, Earned Run Average glossary (innings pitched in box-score notation: .1 and .2 are one and two outs). https://www.baseball-reference.com/glossary/earned-run-average/ (retrieved 2026-10-19)"
  ],
  "related": [
    "era",
    "batting-average"
  ],
  "changelog": []
}
