Skip to content
AllCalcHub

Baseball Stats Calculator

Calculate batting average, on-base percentage, slugging, OPS, ERA and WHIP.

About the Baseball Stats Calculator

Batting average is hits per at-bat. On-base percentage counts walks and hit-by-pitches too; slugging weights extra-base hits by total bases. OPS adds the two and is a quick overall measure: about .750 is average for an MLB regular and .900+ is star level. For pitchers, ERA is earned runs per nine innings and WHIP is walks plus hits per inning. Innings are written with outs after the dot: 180.2 means 180⅔.

The formula

OBP = (H + BB + HBP) ÷ (AB + BB + HBP + SF); SLG = TB ÷ AB; ERA = 9 × ER ÷ IP; WHIP = (H + BB) ÷ IP

Worked example

Example: Batting line (AVG/OBP/SLG) = .309 / .387 / .533

  1. Inputs: Stats for: Batting; At bats: 550; Hits: 170; Doubles: 33; Triples: 3; Home runs: 28; Walks: 66; Hit by pitch: 6; Sacrifice flies: 4.
  2. Formula: OBP = (H + BB + HBP) ÷ (AB + BB + HBP + SF); SLG = TB ÷ AB; ERA = 9 × ER ÷ IP; WHIP = (H + BB) ÷ IP
  3. Result: Batting line (AVG/OBP/SLG) = .309 / .387 / .533
  4. AVG: .309
  5. OBP: .387
  6. SLG: .533

Questions people ask

Why isn't a walk an at-bat?

Walks, HBP and sacrifices don't count as at-bats.

What's a good ERA?

Under 3.00 is excellent in MLB; league average is around 4.