Calculate batting average, on-base percentage, slugging, and OPS from a baseball batting line.
| AVG | – |
| OBP | – |
| SLG | – |
| OPS | – |
Use this calculator to turn a batting line into the four standard rate stats: batting average (AVG), on-base percentage (OBP), slugging percentage (SLG), and on-base plus slugging (OPS).
The calculations are: AVG = hits ÷ at-bats; OBP = (hits + walks + hit-by-pitch) ÷ (at-bats + walks + hit-by-pitch + sacrifice flies); SLG = total bases ÷ at-bats; OPS = OBP + SLG. A .300 average with a .400 OBP is a typical strong season sketch.
These are rate stats for the numbers you enter, not a park-adjusted, league-adjusted, or defensive value. Hits cannot exceed at-bats in a real box score, but the formula still runs if they do.
Hits: Safe hits credited to the batter.
At-bats: Official at-bats, not plate appearances. Walks, HBP, sacrifices, and catcher's interference are not at-bats.
Walks: Bases on balls.
HBP: Times hit by a pitch.
Sac flies: Sacrifice flies. They count in the OBP denominator, not in batting average.
Total bases: Singles + 2 × doubles + 3 × triples + 4 × home runs.
AVG: Hits per at-bat, shown as a three-decimal rate such as .300.
OBP: Times the batter reached base by hit, walk, or HBP, divided by the OBP opportunities.
SLG: Total bases per at-bat.
OPS: OBP plus SLG.
Related calculators