BASEBALL STATS CALCULATOR

Baseball stats calculator

Enter a batter's or a pitcher's season line, get the rate stats.

Example: Ted Williams, 1941 (Baseball-Reference). Singles are worked out as H − 2B − 3B − HR.

How do you calculate batting average, on-base percentage and slugging?

Batting average is hits divided by at-bats. On-base percentage is hits plus walks plus hit-by-pitches, divided by at-bats plus walks plus hit-by-pitches plus sacrifice flies. Slugging percentage is total bases divided by at-bats, where a single is 1 base, a double 2, a triple 3 and a home run 4. OPS is on-base plus slugging. Ted Williams in 1941: 185 hits in 456 at-bats is .406; 335 times on base in 606 chances is .553; 335 total bases is .735; OPS is 1.287.

What are ISO and BABIP?

Isolated power (ISO) is slugging percentage minus batting average, or (doubles + 2 × triples + 3 × home runs) ÷ at-bats; it measures raw power. Batting average on balls in play (BABIP) is (hits − home runs) ÷ (at-bats − strikeouts − home runs + sacrifice flies): it removes outcomes the defense cannot affect. Williams in 1941 had an ISO of .329 and a BABIP of .378; the league average BABIP is typically around .300, according to MLB.

How is ERA calculated, and how do I enter partial innings?

ERA is earned runs times 9, divided by innings pitched. Each out is a third of an inning, and box scores write 304⅔ innings as 304.2, so “.1” means one out and “.2” two outs. Bob Gibson in 1968 allowed 38 earned runs in 304.2 innings: 38 × 9 ÷ 304⅔ = 1.12. The rulebook’s own example is 9⅓ innings and 3 earned runs, an ERA of 2.89.

What are WHIP, K/9, BB/9 and K/BB?

WHIP is walks plus hits per inning pitched. K/9 and BB/9 are strikeouts and walks times 9, divided by innings pitched, and K/BB is strikeouts divided by walks. Gibson’s 1968 line of 198 hits, 62 walks and 268 strikeouts in 304.2 innings gives a WHIP of 0.853, 7.9 strikeouts and 1.8 walks per nine innings, and 4.32 strikeouts per walk.

How many at-bats or innings do you need to qualify for a title?

Under rule 9.22 of the Official Baseball Rules, a batting, slugging or on-base title needs 3.1 plate appearances for each game on the team schedule, which is 502 in a 162-game season. The ERA title needs one inning pitched per scheduled team game, which is 162. This calculator does not apply that minimum. It also leaves out FIP, which needs a constant that changes every season.

Worked example: a made-up season line for a hitter

Take 500 at-bats, 150 hits (30 doubles, 3 triples, 20 home runs), 60 walks, 5 hit-by-pitches, 5 sacrifice flies and 100 strikeouts. Singles are 150 − 30 − 3 − 20 = 97, so total bases are 97 + 60 + 9 + 80 = 246. Batting average is 150 ÷ 500 = .300. On-base percentage is (150 + 60 + 5) ÷ (500 + 60 + 5 + 5) = 215 ÷ 570 = .377. Slugging is 246 ÷ 500 = .492, so OPS is .869. ISO is (30 + 6 + 60) ÷ 500 = .192 and BABIP is (150 − 20) ÷ (500 − 100 − 20 + 5) = 130 ÷ 385 = .338. The numbers are invented for the example, not a real player.

Worked example: a start of six and one-third innings

A pitcher records 19 outs, written 6.1 in a box score, allowing 3 earned runs, 6 hits and 2 walks and striking out 7. The calculator reads 6.1 as 19 outs, which is 6.333 innings. ERA is 3 × 9 ÷ 6.333 = 4.26. WHIP is (2 + 6) ÷ 6.333 = 1.26, K/9 is 9.9 and K/BB is 3.5. Typing 6.33 instead of 6.1 gives a different, wrong result, because the digit after the point counts outs, not tenths.

What counts as an at-bat, and what does not?

A plate appearance is an at-bat unless it ends in a walk, a hit-by-pitch, a sacrifice bunt or sacrifice fly, or catcher's interference, according to the Official Baseball Rules (rule 9.02). That is why on-base percentage has a different denominator from batting average. Sacrifice flies are added to the on-base denominator, but sacrifice bunts are not part of any formula here.

Common mistakes with baseball statistics

Entering the walks and hit-by-pitches in the at-bats box. Entering doubles, triples and home runs as extra hits on top of the hit total: they are part of it, and the calculator refuses a line where they exceed the hits. Averaging OBP and slugging to get OPS: OPS is their sum. Writing innings as decimals (6.33) instead of the box-score form (6.1). Using unearned runs in ERA. Comparing rates over a handful of at-bats: a .400 average over 10 at-bats says little, so look at the sample size before the number.

More sports math: the pace calculator, the golf handicap calculator and the Elo rating calculator.

Sources: Major League Baseball, Official Baseball Rules (2024 edition), rules 9.02 and 9.21–9.22, and the MLB Glossary (mlb.com/glossary) for the definitions; example seasons from Baseball-Reference.com. How we check our calculators.