Calculate batting average and on-base percentage (OBP) from a player's season or game stats.
Batting average measures how often a batter gets a hit per official at-bat, traditionally written without the leading zero (e.g. .306).
Batting Average = Hits ÷ At-Bats
OBP = (Hits + Walks + Hit By Pitch) ÷ (At-Bats + Walks + Hit By Pitch + Sacrifice Flies)
55 hits in 180 at-bats gives a batting average of .306. Adding 20 walks and 2 hit-by-pitch gives an OBP of about .376.
Batting average = hits ÷ at-bats, usually shown to three decimal places (e.g. .300).
No — walks, hit-by-pitches, and sacrifices are excluded from at-bats in the standard batting average formula, which is why on-base percentage is a separate, complementary stat.
In most amateur and professional baseball leagues, .300 or higher is considered a strong batting average, though the benchmark varies by level of play.