⚾ Batting Average Calculator

Enter hits, at-bats, and optional walks/total bases to compute batting average, on-base percentage (OBP), and slugging percentage (SLG).

Four numbers, four rates

Batting average is hits over at-bats. The other three widen the denominator or the numerator to count walks and extra-base hits:

AVG = H / AB
OBP = (H + BB) / (AB + BB)
SLG = TB / AB
OPS = OBP + SLG

The sample line - 45 hits in 150 at-bats, 10 walks, 63 total bases - gives .300, .344, .420 and an OPS of .764. Results print in baseball's leading-dot style to three decimals, so .300 means 30 hits per 100 at-bats.

Where total bases comes from

Total bases counts each hit by how far it went: a single is 1, a double 2, a triple 3, a home run 4.

TB = 1B + 2×2B + 3×3B + 4×HR
This is the simplified OBP. The official version also counts hit-by-pitch and sacrifice flies, as (H + BB + HBP) / (AB + BB + HBP + SF), so a batter who gets plunked often will read a few points low here.

Frequently asked questions

How do you calculate batting average?

Divide hits by at-bats and round to three decimals. 45 hits in 150 at-bats is .300. Walks, sacrifices and hit-by-pitch are not at-bats, so they are left out entirely.

What is a good batting average?

.300 has been the marker of a strong hitter for a century. League average runs around .245 to .250, and .200 is the line below which a player is said to be batting under the Mendoza line.

Why is OPS not a percentage?

It adds two rates with different denominators, so it is an index rather than a real proportion. It is used because it is simple and tracks run scoring well; .800 is good and .900 is excellent.