Guide
Batting average, OBP, OPS, ERA and WHIP explained
Batting average is hits divided by at-bats, on-base percentage counts how often a hitter reaches base, OPS adds on-base and slugging together, ERA is earned runs per nine innings, and WHIP is walks plus hits per inning pitched. Here is how each one works, with simple examples.
Why baseball stats look the way they do
Baseball is a game of many small, countable events, so it has lots of numbers. The good news is that most come from a few formulas. Once you know them, a box score or a player card becomes a story. If you want a quick reference list, see our stats glossary, and for a game summary, read how to read a box score. This guide goes deeper on the formulas.
Batting average (AVG or BA)
Formula: hits divided by at-bats.
Example: A player has 12 hits in 40 at-bats. 12 divided by 40 is .300, which is read as "three hundred."
- Walks, hit-by-pitches and sacrifices do not count as at-bats. A player who walks has not had a chance to get a hit.
- Batting average treats every hit the same, so a single and a home run count the same.
- It is shown with three decimal places and no leading zero, so .250 means one hit in every four at-bats.
On-base percentage (OBP)
Formula: (hits + walks + hit-by-pitches) divided by (at-bats + walks + hit-by-pitches + sacrifice flies).
Example: A player has 12 hits, 6 walks and 1 hit-by-pitch in 40 at-bats, with no sacrifice flies. Top: 12 + 6 + 1 = 19. Bottom: 40 + 6 + 1 = 47. OBP is 19 divided by 47, which is about .404.
OBP answers a simple question: how often does this player not make an out? In youth baseball, where walks are common, OBP can tell you a lot more than batting average. A patient hitter who walks often is helping the team even without a hit.
Slugging and OPS
Slugging percentage (SLG) is total bases divided by at-bats. A single is one total base, a double two, a triple three and a home run four.
Example: In 40 at-bats, a player has 8 singles, 3 doubles and 1 home run. Total bases: 8 + 6 + 4 = 18. SLG is 18 divided by 40, or .450.
OPS is simply OBP plus SLG. Using the numbers above, a .404 OBP plus a .450 SLG is an OPS of .854. It is a quick way to combine getting on base and hitting for power. Note that it is not a precise formula, just a handy summary.
ERA (earned run average)
Formula: earned runs times the number of innings in a regulation game, divided by innings pitched. In professional baseball that is nine innings.
Example: A pitcher gives up 3 earned runs in 6 innings. 3 times 9 is 27, divided by 6 is 4.50. That is a 4.50 ERA.
- An earned run is a run that scores without the help of an error or a passed ball. If a fielder's error lets a runner reach or advance, the run may be unearned and does not count toward ERA. The official scorer decides.
- Youth leagues with six- or seven-inning games often compute ERA per six or seven innings instead of nine. Check how your league or app does it before comparing numbers.
- Lower is better.
WHIP
Formula: (walks + hits) divided by innings pitched.
Example: A pitcher allows 4 hits and 2 walks in 6 innings. 4 + 2 = 6, and 6 divided by 6 is 1.00.
WHIP tells you how many runners a pitcher allows on base per inning. Lower is better. It ignores errors and hit-by-pitches, and for a young pitcher it is useful to see how control, meaning walks, affects the game.
Reading innings pitched
Innings pitched is written with a decimal that is not a decimal. Each out is one third of an inning, so .1 means one extra out and .2 means two extra outs. Five innings and two outs is written as 5.2. It is never 5.3, because three outs make a full inning, so the next number is 6.0. When using these figures in a formula, convert 5.2 to five and two-thirds, or about 5.67.
Which stat should you look at?
No one number tells the whole story, so match the stat to the question you are asking. If you want to know who makes contact, batting average is a good start. If you want to know who helps the team by not making outs, check OBP. If you want a sense of power, look at slugging. For pitchers, ERA reflects runs, and WHIP reflects how many runners reach base. In youth baseball, where errors and walks are frequent, a pitcher's ERA can swing because of defense behind them, so WHIP, strikeouts and walks can show more about the pitcher's own work. You can see the terms used for these in the scorekeeping guide, where each event is recorded.
Quick reference
| Stat | Formula | Better is |
|---|---|---|
| AVG | Hits / at-bats | Higher |
| OBP | (H + BB + HBP) / (AB + BB + HBP + SF) | Higher |
| SLG | Total bases / at-bats | Higher |
| OPS | OBP + SLG | Higher |
| ERA | Earned runs x innings in a game / innings pitched | Lower |
| WHIP | (BB + H) / innings pitched | Lower |
A caution about small samples
Another point is that batting average does not reward patience, so a hitter who walks often may have a lower average than a free swinger yet help the team more. Likewise, a pitcher who strikes out batters but gives up a few runs on errors may look worse than they pitched. Treat the formulas as tools to spot patterns, not as grades.
Youth players have short seasons, so one good or bad game swings the numbers dramatically. A player who goes 3 for 4 in one game and 0 for 3 in the next is fine either way. Look at trends over time, such as better contact, fewer strikeouts or more walks, and let the numbers tell a story without making the child feel judged. Great hitters make outs a lot of the time, and every pitcher gives up hits. Stats should serve the fun of the game.
In BlackForge Sports: batting, pitching and fielding numbers come from scored games, so a player's card and season line update as games are scored, with nothing on the stats screen typed in by hand. Get early access →
Sources and further reading
- Baseball - Rules, Strategy, Stats Encyclopaedia Britannica
- Batting average (baseball) Wikipedia
- On-base percentage Wikipedia
Links open in a new tab. Quotations are short excerpts, included with attribution for commentary. BlackForge Sports is not affiliated with or endorsed by the people or organizations named.
Frequently asked questions
How do you calculate batting average?
Divide hits by at-bats. For example, 12 hits in 40 at-bats is .300.
Do walks count as at-bats?
No. Walks, hit-by-pitches and sacrifices are not at-bats, so they do not hurt batting average, but walks and hit-by-pitches do count in on-base percentage.
What is a good OPS?
There is no single answer, since it depends on the level. Compare players with others in the same league and age group instead of using pro benchmarks.
How do you calculate ERA?
Multiply earned runs by the number of innings in a regulation game, such as nine, then divide by innings pitched. 3 earned runs in 6 innings is a 4.50 ERA over nine.
What does 5.2 innings pitched mean?
Five full innings plus two outs, or five and two-thirds innings. The number after the decimal is outs, so it only goes up to .2.