Baseball Stats Explained: AVG, OBP, SLG, OPS, ERA, WHIP and More
Baseball stats explained in plain English: what AVG, OBP, SLG, OPS, ERA and WHIP measure, the official formulas behind them, and a worked example for each.

Baseball stats are the numbers the official scorer records for every batter, pitcher and fielder, plus the averages built from them. For hitters, the best-known averages are batting average, slugging percentage and on-base percentage; for pitchers, they are earned run average and WHIP. Their formulas come from MLB’s Official Baseball Rules and MLB’s official glossary, and this guide walks through each one with an example.
Totals and Percentage Records
The rulebook treats these numbers in two steps. First, the official scorer’s report lists raw totals for each batter, such as times at bat, runs, hits, doubles, triples, home runs, runs batted in, stolen bases, walks, times hit by a pitch and strikeouts. Then a separate rule, on “percentage records,” explains how to turn those totals into averages.
The At-Bat Comes First
Many hitting formulas divide by at-bats, and an at-bat is narrower than a trip to the plate. The scoring rules say no time at bat is charged when a batter:
- hits a sacrifice bunt or a sacrifice fly,
- draws a base on balls,
- gets hit by a pitch, or
- is sent to first because of interference, obstruction or a shift restriction violation.
So a hitter who comes up five times, walks once and lays down one sacrifice bunt has only three at-bats.
Hitting Stats
Batting Average (AVG)
For batting average, the rulebook has you take the batter’s safe hits and divide them by times at bat. It specifically says to use hits, not total bases, so a single and a home run each add one.
AVG = Hits / At-Bats
Example: 30 hits in 100 at-bats gives a .300 average.
On-Base Percentage (OBP)
MLB’s glossary describes on-base percentage as how often a batter reaches base per plate appearance. Under the rulebook, you add hits, walks and times hit by a pitch, then divide by at-bats plus walks plus times hit by a pitch plus sacrifice flies.
OBP = (Hits + Walks + Hit by Pitch) / (At-Bats + Walks + Hit by Pitch + Sacrifice Flies)
The rule also tells scorers to skip any time a batter reached first on interference, obstruction or a shift restriction violation. The glossary adds that sacrifice bunts are left out of the formula entirely.
Example: 30 hits, 10 walks and 2 times hit by a pitch, with 100 at-bats and 3 sacrifice flies, gives 42 / 115, an OBP of .365.
Slugging Percentage (SLG)
MLB’s glossary calls slugging percentage one of the best ways to judge a hitter’s power. It weights each hit by the bases it produced: a single counts one, a double two, a triple three and a home run four. That total is divided by at-bats.
SLG = (Singles + Doubles x 2 + Triples x 3 + Home Runs x 4) / At-Bats
Example: if those 30 hits were 20 singles, 6 doubles, 1 triple and 3 home runs, total bases are 20 + 12 + 3 + 12 = 47, and SLG is 47 / 100 = .470.
On-Base Plus Slugging (OPS)
According to MLB’s glossary, OPS joins on-base percentage and slugging percentage into a single figure by adding them.
OPS = OBP + SLG
Example: .365 + .470 = .835.
MLB’s glossary also describes the slash line, which puts three hitting rates side by side with slashes: batting average first, on-base percentage second, slugging percentage last. The example hitter’s slash line would be .300/.365/.470.
Other Common Hitting Numbers
- Runs batted in: credited to a batter whose action at the plate makes a run score.
- Stolen bases: credited when a runner moves up a base without the help of a hit, putout, error, force-out, fielder’s choice, passed ball, wild pitch or balk.
- Strikeouts: charged to the batter, and credited to the pitcher, when the umpire calls three strikes.
Pitching Stats
Earned Run Average (ERA)
The rulebook formula for ERA takes earned runs, multiplies them by 9, and divides by innings pitched, partial innings included.
ERA = 9 x Earned Runs / Innings Pitched
The rulebook works one example: 3 earned runs in 9 and one-third innings is an ERA of 2.89.
To decide which runs are earned, the official scorer rebuilds the inning with the errors and passed balls taken out, leaning toward the pitcher whenever there is doubt.
WHIP
WHIP is short for walks and hits per inning pitched. MLB’s glossary adds walks and hits together, then divides by innings pitched.
WHIP = (Walks + Hits) / Innings Pitched
Example: 6 walks and 30 hits across 30 innings is 36 / 30, a WHIP of 1.20. Per the MLB glossary, a batter hit by a pitch, a runner safe on an error, and a fielder’s-choice runner are all left out.
Innings Pitched
MLB’s glossary explains that a pitcher earns one third of an inning for each out made while they are in the game, and a double play is worth two thirds. Convert partial innings into thirds before you divide for ERA or WHIP.
Fielding Stats
The rulebook also gives a formula for fielding average. Add putouts and assists, then divide by that total plus errors. The rule calls the bottom number “chances.”
Fielding Average = (Putouts + Assists) / (Putouts + Assists + Errors)
Example: 95 putouts, 40 assists and 5 errors gives 135 / 140, a fielding average of .964.
Frequently Asked Questions
Why do walks not count in batting average?
The scoring rules do not charge a time at bat for a base on balls, and batting average is hits divided by at-bats. Walks are counted in on-base percentage instead.
What is the difference between OBP and OPS?
OBP is one rate on its own, built from hits, walks, times hit by a pitch, at-bats and sacrifice flies. OPS takes that OBP figure and adds slugging percentage to it.
How are partial innings handled in ERA and WHIP?
Each out is one third of an inning. The rulebook includes partial innings in ERA, as its 9 and one-third inning example shows, so convert the total into whole innings plus thirds before dividing.


