What question does each statistic answer?
Batting average, on-base percentage, slugging percentage, and OPS describe different parts of a hitter’s results. AVG asks how often the batter gets a hit per official at-bat. OBP measures how often the batter reaches base through a hit, walk, or hit-by-pitch across a broader set of opportunities. SLG measures total bases from hits per at-bat, giving extra-base hits more weight. OPS adds OBP and SLG into one number.
For pitchers, ERA expresses earned runs allowed per nine innings, while WHIP measures walks and hits allowed per inning pitched. Their denominators matter just as much as their names: a rate makes sense only when you know which opportunities it counts.
The worked examples below come from one fictional MLB game. These arbitrary, one-game lines illustrate the calculations; they provide little basis for judging a player’s overall ability.
Batting statistics: follow the denominator
A plate appearance, abbreviated PA, represents a completed turn at the plate. An official at-bat, or AB, is a narrower scoring category. Walks, hit-by-pitches, sacrifice bunts, and sacrifice flies do not count as at-bats. An award of first base because of interference or obstruction also does not count as an at-bat. Those distinctions follow Official Baseball Rules, Rule 9.02(a).
The four batting formulas are:
- AVG = H ÷ AB. H means hits; each hit counts once.
- OBP = (H + BB + HBP) ÷ (AB + BB + HBP + SF). BB means walks, HBP means hit-by-pitches, and SF means sacrifice flies.
- SLG = TB ÷ AB. TB means total bases from hits: one for a single, two for a double, three for a triple, and four for a home run.
- OPS = OBP + SLG. Calculate the two component rates, then add them.
OBP’s denominator deserves particular attention. Sacrifice flies count in it, while sacrifice bunts do not. The official formula also excludes instances in which the batter receives first base through interference or obstruction. Reaching on an error or a fielder’s choice does not contribute to its numerator. See Rule 9.21 for the official batting-rate calculations.
A worked comparison from the same game
M5 has three at-bats and one hit, a double, with no walks, hit-by-pitches, or sacrifice flies. M6 also has three at-bats and one hit, but that hit is a single. M4 finishes with three plate appearances: two hitless at-bats and one walk. M8 has three plate appearances, two hitless at-bats, and one sacrifice fly. None of these examples includes a hit-by-pitch.
| Player and measure | Numerator or operation | Denominator | Result |
|---|---|---|---|
| M5: AVG | 1 hit | 3 AB | 1 ÷ 3 = .333 |
| M5: OBP | 1 H + 0 BB + 0 HBP = 1 | 3 AB + 0 BB + 0 HBP + 0 SF = 3 | 1 ÷ 3 = .333 |
| M5: SLG | 2 TB from the double | 3 AB | 2 ÷ 3 = .667 |
| M5: OPS | OBP + SLG = 1/3 + 2/3 | Sum of the two rates | 1.000 |
| M6: AVG | 1 hit | 3 AB | 1 ÷ 3 = .333 |
| M6: SLG | 1 TB from the single | 3 AB | 1 ÷ 3 = .333 |
| M4: AVG | 0 hits | 2 AB | 0 ÷ 2 = .000 |
| M4: OBP | 0 H + 1 BB + 0 HBP = 1 | 2 AB + 1 BB + 0 HBP + 0 SF = 3 | 1 ÷ 3 = .333 |
| M8: PA and AB | 2 AB + 1 SF | Not a rate calculation | 3 PA; 2 AB |
In words, M5’s line produces a .333 AVG, .333 OBP, .667 SLG, and 1.000 OPS. M6 matches M5’s .333 AVG, while the single produces a .333 SLG. M4’s walk produces a .333 OBP alongside a .000 AVG. M8’s sacrifice fly accounts for the difference between three plate appearances and two at-bats.
The double explains M5’s higher slugging percentage: both hitters have one hit, but the double contributes two total bases. Bases gained later through advancing on a teammate’s play do not increase a hitter’s TB.
Where runs and RBI fit
RBI means run batted in. A hit or sacrifice fly that brings a runner home typically earns the batter an RBI. Official scoring has exceptions; for example, a batter receives no RBI for a run that scores while the batter grounds into a force double play or reverse-force double play. The governing provisions are in Rule 9.04.
In the bottom of the fifth, M6’s single drives in two runs, earning two RBI. M6 later scores Mill’s third run on M8’s deciding sacrifice fly to right field, recorded as SF9. On that play, M6 receives a run scored and M8 receives one RBI. M8’s sacrifice fly counts as a plate appearance and enters the OBP denominator, but it adds neither an at-bat nor a hit.
Round after calculating
Keep the underlying fractions or full precision until the final calculation. For M5, OBP is 1/3 and SLG is 2/3, so OPS is exactly 1.000. The displayed values, .333 and .667, happen to add to that same result. In other lines, adding already-rounded rates can change the last displayed digit.
Pitching statistics: ERA and WHIP
Lee’s line in the same fictional game is five innings pitched, four hits allowed, two earned runs, one walk, and four strikeouts. Innings pitched is abbreviated IP, earned runs ER, and strikeouts K.
ERA = (ER × 9) ÷ IP. It scales the pitcher’s earned runs to nine innings. Earned runs are determined under the official scoring rules, so the calculation requires ER rather than simply every run that scored. See Rules 9.16 and 9.21.
WHIP = (BB + H) ÷ IP. It counts walks and hits allowed per inning; hit-by-pitches are excluded from its numerator. MLB defines the measure in its WHIP glossary entry.
| Measure | Calculation | Result |
|---|---|---|
| ERA | (2 ER × 9) ÷ 5 IP | 3.60 |
| WHIP | (1 BB + 4 H) ÷ 5 IP | 1.00 |
Lee’s two earned runs across five innings produce a 3.60 ERA. The combined five walks and hits across those innings produce a 1.00 WHIP. The four strikeouts provide additional context but enter neither formula.
Take care with partial innings. An IP entry of 5.1 means five innings and one out, or 5⅓ innings. It is not 5.10 innings in decimal arithmetic. Convert the outs to thirds before using innings pitched in a calculation.
To connect these numbers with the plays that produce them, a useful next topic is How to Keep Score in Baseball: Annotated Scorecard. For the separate question of who receives the pitching decision, continue with Winning Pitcher Rules: How MLB Awards a Win.
