Batting Average Calculator with OBP, SLG and OPS
- By Julien Levadoux
Batting average is hits ÷ at-bats. On-base percentage adds walks and hit by pitch. Slugging counts total bases per at-bat. OPS is on-base plus slugging.
The four numbers
| Stat | Formula | What it tells you |
|---|---|---|
| AVG | hits ÷ at-bats | How often an at-bat ends in a hit |
| OBP | (hits + walks + hit by pitch) ÷ (at-bats + walks + hit by pitch + sacrifice flies) | How often a hitter reaches base |
| SLG | total bases ÷ at-bats | Hits weighted by how far they go: a double counts 2, a home run 4 |
| OPS | OBP + SLG | Getting on and hitting for power, in one number |
Averages are written without the zero in front: .300 is a hit in 3 of every 10 at-bats.
What counts as an at-bat
An at-bat is a plate appearance minus the ones the batter isn’t held responsible for. Walks, hit by pitch, sacrifice bunts, sacrifice flies and catcher’s interference are not at-bats. That’s why a player can go 2 for 2 in a game they came to the plate 4 times.
Reaching on an error, or on a fielder’s choice, is an at-bat, and it isn’t a hit. Parents often count those as hits; the scorebook doesn’t.
A worked line
42 at-bats, 14 hits (3 doubles, 1 triple, 2 home runs), 6 walks, 1 hit by pitch, 1 sacrifice fly:
- AVG = 14 ÷ 42 = .333
- OBP = (14 + 6 + 1) ÷ (42 + 6 + 1 + 1) = 21 ÷ 50 = .420
- Total bases = 8 singles + 2 × 3 + 3 × 1 + 4 × 2 = 25, so SLG = 25 ÷ 42 = .595
- OPS = .420 + .595 = 1.015