How to use it
- Type the batting totals from the box score: at bats, hits, doubles, triples, home runs, walks, hit by pitch and sacrifice flies.
- Type the pitching totals: Innings pitched as 6.1, 6.2 or a whole number, then earned runs, hits allowed, walks allowed and strikeouts.
- Read the rates, and open Working for each formula with its numbers. Leave a section empty to hide its rates.
The batting rates
Batting average divides hits by at bats. On-base percentage counts hits, walks and hit-by-pitches over at bats, walks, hit-by-pitches and sacrifice flies; sacrifice bunts are left out. Slugging percentage gives each hit its bases (a single 1, a double 2, a triple 3, a home run 4) and divides by at bats. OPS adds on-base and slugging percentages.
AVG = H ÷ AB
OBP = (H + BB + HBP) ÷ (AB + BB + HBP + SF)
SLG = (1B + 2 × 2B + 3 × 3B + 4 × HR) ÷ AB
OPS = OBP + SLG
The pitching rates
ERA is nine times the earned runs over the innings pitched. Earned runs leave out runs that scored by an error or a passed ball. WHIP is walks plus hits per inning, and K/9 and BB/9 are strikeouts and walks per nine innings.
Innings are counted in outs. Each out is one third of an inning, so 6.1 is 19 outs, or 6 1/3 innings.
ERA = 9 × ER ÷ IP
WHIP = (BB + H) ÷ IP
K/9 = 9 × K ÷ IP
BB/9 = 9 × BB ÷ IP
IP = outs ÷ 3, so 6.1 = 19 ÷ 3
What the calculator does not cover
- Adjusted stats such as ERA+ or OPS+, which compare a player with the league or the ballpark.
- Stats that need play-by-play data, such as runs batted in or runs created.
- Any reading of a small sample. A few games say little about a season, whatever the rate shows.
Worked example: a hitter and a pitcher
The default hitter has 500 at bats, 150 hits (30 doubles, 3 triples, 25 home runs), 60 walks, 5 hit by pitch and 4 sacrifice flies. Total bases are 92 + 60 + 9 + 100 = 261, so SLG is 261 ÷ 500 = 0.522. OBP is (150 + 60 + 5) ÷ (500 + 60 + 5 + 4) = 215 ÷ 569 = 0.378, and OPS is 0.378 + 0.522 = 0.900.
The default pitcher threw 6.1 innings (19 outs) and allowed 2 earned runs, 5 hits and 2 walks, with 7 strikeouts. ERA is 9 × 2 ÷ 6.333 = 2.84, WHIP is (2 + 5) ÷ 6.333 = 1.11, K/9 is 9 × 7 ÷ 6.333 = 9.9 and BB/9 is 9 × 2 ÷ 6.333 = 2.8.
| Measure | Value |
|---|---|
| Batting average (AVG) | 0.300 |
| On-base percentage (OBP) | 0.378 |
| Slugging percentage (SLG) | 0.522 |
| On-base plus slugging (OPS) | 0.900 |
| Earned run average (ERA) | 2.84 |
| Walks plus hits per inning (WHIP) | 1.11 |
| Strikeouts per nine innings (K/9) | 9.9 |
| Walks per nine innings (BB/9) | 2.8 |
Frequently asked questions
Why does a sacrifice fly lower OBP but not AVG?
MLB says a sacrifice fly does not count as an at bat, so it stays out of batting average. It does count against on-base percentage, so the OBP formula puts it in the denominator.
What does 6.1 innings mean?
Six innings and one out. MLB counts each out as one third of an inning, so 6.1 is 19 outs, or 6 1/3 innings, and 6.2 is 20 outs, or 6 2/3 innings.
Do intentional walks count in these stats?
Yes. MLB counts an intentional walk as a walk for the hitter and as a walk allowed by the pitcher, so the calculator counts it with walks.
Why are hit batters left out of WHIP?
MLB says hit batsmen do not count against WHIP. The formula uses walks and hits only, and hit-by-pitches are a separate statistic.
Why does a rate show a dash?
A rate needs a divisor: AVG and SLG need at bats, and the pitching rates need innings. A dash means that count is zero, so the rate cannot be worked out.
Are earned runs the same as all runs?
No. MLB defines an earned run as a run that scores without the aid of an error or a passed ball. ERA uses earned runs, so type the earned runs of the pitcher.
Sources
- MLB.com glossary: batting average, on-base percentage, slugging percentage, OPS, ERA, WHIP, innings pitched
- Wikipedia: Baseball statistics (on-base percentage formula)
Figures and text last checked on Tuesday, November 10, 2026.