What is my batting average?
Type the hits and at-bats. The batting average calculator divides them as the baseball rules do and writes the average to three places. Add walks and extra-base hits for OBP, slugging and OPS.
- Batting average
- .375
165 hits in 440 at-bats is a batting average of .375.
- Batting average (AVG)
- 0.375
Batting average: .375. 165 hits in 440 at-bats is a batting average of .375.
How to calculate
Computes a batting average (hits ÷ at-bats) as Official Baseball Rule 9.21 defines it, with on-base percentage, slugging percentage and OPS when you add walks, hit by pitches, sacrifice flies and extra-base hits.
Example with the default inputs (Hits (H) 165, At-bats (AB) 440): 165 hits in 440 at-bats is a batting average of .375.
Method: AVG = H ÷ AB; OBP = (H + BB + HBP) ÷ (AB + BB + HBP + SF); SLG = TB ÷ AB with TB = H + 2B + 2 × 3B + 3 × HR; OPS = OBP + SLG.
- At-bats are official at-bats (Rule 9.02(a)): walks, hit by pitches, sacrifice bunts and flies, and catcher’s interference do not count.
- Empty walks leave out OBP and OPS; empty doubles, triples and home runs leave out slugging and OPS. Inside each, an empty count is 0.
Worked examples
Each example is checked against the calculator on every build.
- Hits (H) 165, At-bats (AB) 440 gives Batting average (AVG) 0.375, Batting average .375.Source: Official Baseball Rules (2025), Rule 9.22(a) Minimum Standards for Individual Championships, example (Baker, .375), https://baseballrulesacademy.com/official-rule/mlb/9-22-minimum-standards-individual-championships/
- Hits (H) 165, At-bats (AB) 452 gives Batting average (AVG) 0.365044, Batting average .365.Source: Official Baseball Rules (2025), Rule 9.22(a), example (.365 with 12 more at-bats), https://baseballrulesacademy.com/official-rule/mlb/9-22-minimum-standards-individual-championships/
- Hits (H) 150, At-bats (AB) 500, Walks (BB) 60, Hit by pitch (HBP) 5, Sacrifice flies (SF) 5, Doubles (2B) 30, Triples (3B) 2, Home runs (HR) 25 gives Batting average (AVG) 0.3, Batting average .300, On-base percentage (OBP) 0.377193, Total bases (TB) 259, Slugging percentage (SLG) 0.518, OPS 0.895193.Source: Official Baseball Rules (2025), Rule 9.21 Determining Percentage Records, https://baseballrulesacademy.com/official-rule/mlb/9-21-determining-percentage-records/
- Hits (H) 3, At-bats (AB) 16 gives Batting average (AVG) 0.1875, Batting average .188.Source: Official Baseball Rules (2025), Rule 9.21 Determining Percentage Records, https://baseballrulesacademy.com/official-rule/mlb/9-21-determining-percentage-records/
How it works
Official Baseball Rule 9.21 defines the rates:
- Batting average AVG = H ÷ AB.
- On-base percentage OBP = (H + BB + HBP) ÷ (AB + BB + HBP + SF).
- Slugging percentage SLG = TB ÷ AB, with total bases TB = H + 2B + 2 × 3B + 3 × HR (a single counts 1 base, a double 2, a triple 3, a home run 4).
- OPS = OBP + SLG.
H is hits, AB official at-bats, BB walks, HBP hit by pitch, SF sacrifice flies, 2B doubles, 3B triples and HR home runs.
Which results show. The batting average always shows. OBP shows when you fill in walks (hit by pitch and sacrifice flies then count as 0 if empty). Slugging and total bases show when you fill in any of doubles, triples or home runs (the empty ones count as 0). OPS shows when both do.
Rules. Every count is a whole number from 0 to 100,000, and at-bats at least 1. Hits cannot be more than at-bats, and doubles + triples + home runs cannot be more than hits; the page gives no answer and says why.
Output format. The headline is the batting average rounded half up from the exact fraction to three places and written with no leading zero (.375; 1.000 for a perfect average). AVG, OBP, SLG and OPS in the list show at most three decimals with trailing zeros dropped (0.3), rounded half up from the decimal value. Each is one division of whole numbers, and OPS is added as one fraction, (n₁ × d₂ + n₂ × d₁) ÷ (d₁ × d₂), so each result is the nearest number to the exact fraction before it is rounded.
Assumptions
- At-bats are official at-bats as Rules 9.02(a) and 10.02(a) count them.
- The rates are the same for baseball and softball.
Worked examples by hand
Baker (Rule 9.22 example). 165 ÷ 440 = 0.375, written .375. With 12 hitless at-bats added: 165 ÷ 452 = 0.36504, written .365.
A full season. H 150, AB 500, BB 60, HBP 5, SF 5, 2B 30, 3B 2, HR 25. AVG = 150 ÷ 500 = .300. OBP = (150 + 60 + 5) ÷ (500 + 60 + 5 + 5) = 215 ÷ 570 = .377. TB = 150 + 30 + 2 × 2 + 3 × 25 = 259; SLG = 259 ÷ 500 = .518. OPS = 0.37719 + 0.518 = .895.
A half-way value. 3 ÷ 16 = 0.1875, written .188.
Other questions people ask
How do you calculate a batting average?
Divide hits by official at-bats. Official Baseball Rule 9.21 says to divide the safe hits, not the total bases, by the times at bat. 165 hits in 440 at-bats is 165 ÷ 440 = .375.
Do walks count as at-bats?
No. Walks, hit by pitches, sacrifice bunts, sacrifice flies and catcher’s interference are plate appearances but not at-bats, so they do not change the batting average. Walks and hit by pitches do raise the on-base percentage.
How is a batting average rounded?
It is written to three decimal places with the leading zero left off, so 0.2875 is written .288. This page rounds half up from the exact fraction: 3 hits in 16 at-bats is 0.1875 and is written .188.
What is a good batting average?
In Major League Baseball, .300 or better is excellent and about .250 is typical; few regular hitters finish below .200. In youth and amateur leagues, averages are often higher because of the level of pitching and defence.
How do you calculate OBP, slugging and OPS?
OBP = (H + BB + HBP) ÷ (AB + BB + HBP + SF). Slugging = total bases ÷ AB, where total bases = H + 2B + 2 × 3B + 3 × HR. OPS = OBP + SLG. A .300 hitter with 60 walks, 5 HBP, 5 SF and 259 total bases in 500 at-bats has a .377 OBP, a .518 SLG and a .895 OPS.
How many plate appearances does a batting title need?
Rule 9.22(a) asks for 3.1 plate appearances per scheduled game, 502 in a 162-game season. A player short of that still wins if his average stays the highest after the missing appearances are added as hitless at-bats: Baker’s 165 for 440 (.375) becomes 165 for 452, .365.