Baseball Batting Average Calculator (Hits ÷ At-Bats)
Free baseball batting average calculator: hits ÷ at-bats, straight from Official Baseball Rule 9.21(b). Also solves for the hits you need to hit a target.
Batting Average Calculator
Background.
Batting average is the oldest rate statistic in baseball and the one every fan can recite, but it is also the one most often computed with the wrong denominator. The official definition is a single line in the Official Baseball Rules. Rule 9.21(b) instructs the scorer to compute batting average by dividing "the total number of safe hits (not the total bases on hits) by the total times at bat, as defined in Rule 9.02(a)". Hits over at-bats. Not hits over plate appearances, not hits over games, and emphatically not total bases over at-bats — that last one is slugging percentage, a different statistic entirely.
The whole difficulty lives in the denominator. An at-bat is not the same thing as a turn at the plate. Rule 9.02(a)(1) says no time at bat shall be charged when a player hits a sacrifice bunt or a sacrifice fly, is awarded first base on four called balls, is hit by a pitched ball, or is awarded first base because of interference, obstruction or a shift restriction violation. Five different ways of completing a plate appearance simply vanish from the batting-average calculation. A hitter who walks four times and singles once in five trips to the plate is 1-for-1 and batting 1.000 for the day. That is not a quirk of the arithmetic; it is the design, and it is precisely why on-base percentage was invented.
This calculator implements Rule 9.21(b) exactly and adds two inverse modes, because the two questions fans actually ask are rarely "what is my average?" — they usually already know that — but "how many hits do I need?" and "how many at-bats does that average imply?". Both are the same identity rearranged. The forward-looking outputs answer the question underneath all three: how much does the next plate appearance actually matter? A hitter at .332 over 636 at-bats gains about one point of average for a hit and loses about half a point for an out, so a good week can move an average twice as fast as a bad one can drag it back. Early in a season the same two numbers are ten and twenty times larger, which is the arithmetic reason April batting averages are meaningless and September ones are hard to shift.
The page also draws a line that trips up a lot of search traffic. Cricket has a statistic called batting average too, and it is not this one. Cricket divides runs scored by the number of times the batter was dismissed, so a not-out innings makes the denominator smaller rather than larger. Baseball divides hits by at-bats. The two numbers share a name, live on completely different scales — a good cricket average is 50, a good baseball average is 0.300 — and cannot be converted into each other. Quanta has a separate cricket batting average calculator, linked below, and using the wrong one will produce a number that means nothing.
Below the widget you will find the rule text with its exact wording, the full list of plate-appearance outcomes that are and are not at-bats, a worked example reproducing the 2024 American League batting champion's line from official MLB data, the qualifying rule that decides who is even eligible for a batting title, an honest account of what the statistic misses — walks, extra-base power, situation, park, era — and the reason a .250 average meant something different in 1994 than it does today. The formula is dispatched at battingAverage.calculate in the Quanta engine and pinned by unit tests against the two figures the rulebook itself prints in its Rule 9.22(a) Comment.
What is batting average calculator?
Batting average (abbreviated AVG, or BA) is a hitter's safe hits divided by his official at-bats. It is expressed to three decimal places with the leading zero dropped: a hitter with 211 hits in 636 at-bats has a .332 average, spoken as "three thirty-two". Because the denominator excludes walks, hit-by-pitches, sacrifice bunts, sacrifice flies and interference awards, batting average measures success only across the plate appearances where the batter either got a hit or made an out on his own account. The scale runs from .000 to 1.000 in principle; in practice the league-wide figure has hovered near .250 in recent years, and no qualifying hitter has finished a Major League season above .400 since 1941. The same arithmetic applied from the pitcher's side gives batting average against (BAA or opponents' average), which MLB uses heavily in platoon splits precisely because a pitcher cannot have a separate ERA against left-handed hitters. Batting average is a rate, not a volume: it says nothing about how many hits a player accumulated, only how often the ones he took a real swing at landed safely. It is also entirely blind to what kind of hit it was — a bunt single and a grand slam both count as one hit — which is why slugging percentage and OPS exist alongside it.
How to use this calculator.
- Choose your mode. Leave it on the default to compute a batting average from a known line; switch to 'hits needed' or 'at-bats implied' to solve the same identity backwards.
- Enter safe hits. Add singles, doubles, triples and home runs together. Reaching base on an error, on a fielder's choice, or on catcher's interference is not a hit — those are outs or awards, not safe hits.
- Enter official at-bats, not plate appearances. If your source only gives you PA, subtract walks, hit-by-pitches, sacrifice bunts, sacrifice flies and any interference awards. Every box score that lists AB has already done this for you.
- For the inverse modes, enter the target average as a decimal: .300 is 0.3, .275 is 0.275. The calculator rejects a target above 1.000 because that would require more hits than at-bats.
- Read the primary result to three decimal places — that is how baseball prints it. The calculator carries ten places internally so that the 'after next hit' and 'after next out' figures are exact rather than rounded twice.
- Use the two forward-looking outputs to judge how settled the number is. If one hit moves the average by five points, the sample is far too small to describe the hitter; if it moves it by one point, the season is essentially decided.
The formula.
The forward calculation is one division, and the rulebook states it in one clause: divide safe hits by times at bat. The work is all in assembling the denominator correctly.
Start from plate appearances — every completed turn at the plate. Then remove, in this order, the five outcomes Rule 9.02(a)(1) excludes: sacrifice bunts, sacrifice flies, bases on balls, hit-by-pitches, and awards of first base for interference, obstruction or a shift restriction violation. What remains is the at-bat total. The logic behind each exclusion differs. A walk and a hit-by-pitch are removed because the batter did not put a swing on a hittable pitch and should not be penalised for the pitcher's wildness. A sacrifice bunt is removed because it is a manager's instruction, not a hitter's choice. A sacrifice fly is removed for the same reason, although note carefully that it is removed from batting average and NOT from on-base percentage — that asymmetry is deliberate and is the single most common error in hand-rolled baseball calculators.
The two inverse modes are the identity rearranged. Solving for hits: H = AVG × AB. Ask what a .332 average requires over 636 at-bats and the answer is 211.152 hits, which in practice means 212, because a fraction of a hit does not exist. Solving for at-bats: AB = H ÷ AVG. Ask how many at-bats 211 hits implies at a .332 clip and the answer is 635.54, which tells you the real line was 636 at-bats with a shade of rounding in the published .332.
The two forward-looking outputs come from the same algebra. Adding a hit adds one to both numerator and denominator, giving (H + 1) ÷ (AB + 1); making an out adds one to the denominator only, giving H ÷ (AB + 1). Because the numerator grows in one case and not the other, the upward step is always larger in magnitude than the downward step for any average below 1.000. At 211-for-636 the gain is 0.00105 and the loss is 0.00052, almost exactly two to one.
One precision note. Baseball publishes averages to three decimals, and rounding at three decimals twice — once for the average, once for a derived figure — introduces error visible in the third place. This calculator carries full precision through every intermediate step and rounds once, at the display boundary, which is why the numbers here match the official figures rather than approximating them.
A worked example.
Bobby Witt Jr. of the Kansas City Royals won the 2024 American League batting title. The official MLB Stats API returns his line as 211 safe hits in 636 official at-bats — 45 doubles, 11 triples and 32 home runs among them, though none of that detail matters to batting average, which counts every hit as one. Divide: 211 ÷ 636 = 0.331761006289…, which the calculator returns as 0.3317610063 and which baseball prints as .332. That is exactly the figure in MLB's own record for the season. The supporting outputs fill in the rest of the picture. He made 425 outs in his official at-bats — 636 minus 211 — so even a batting champion failed roughly two times in three. One more hit would have moved him to 212 ÷ 637 = .3328, a gain of just over one point; one more hitless at-bat would have moved him to 211 ÷ 637 = .3312, a loss of just over half a point. That two-to-one asymmetry is why a hot final fortnight can win a batting title and a cold one rarely loses it outright. For contrast, run the same 211 hits through the 'at-bats implied' mode with a target of .332 and you get 635.54 at-bats: the published .332 is a rounded figure, and the true average of 636 at-bats sits a hair below the round number. That gap of half an at-bat is the entire difference between .3317 and .3320, which is a useful reminder of how thin the margins in a batting race actually are.
Frequently asked questions.
What is the batting average formula?
Do walks count in batting average?
Does a sacrifice fly count against your batting average?
What is a good batting average?
How many at-bats do you need to qualify for a batting title?
How do I work out the hits I need to reach a target average?
Can batting average be over 1.000 or below .000?
Is this the same as a cricket batting average?
Why do statisticians say batting average is overrated?
Does batting average work for a single game or a small sample?
References& sources.
- [1]Office of the Commissioner of Baseball (2025). Official Baseball Rules, 2025 Edition, Rule 9.21(b): "Batting average, divide the total number of safe hits (not the total bases on hits) by the total times at bat, as defined in Rule 9.02(a)". This is the definition implemented on this page.
- [2]Office of the Commissioner of Baseball (2025). Official Baseball Rules, Rule 9.02(a)(1): no time at bat is charged when a player hits a sacrifice bunt or sacrifice fly, is awarded first base on four called balls, is hit by a pitched ball, or is awarded first base because of interference, obstruction or shift restriction violation. Source of the at-bat denominator used here.
- [3]Office of the Commissioner of Baseball (2025). Official Baseball Rules, Rule 9.22(a) and Comment: the 3.1-plate-appearance-per-scheduled-game qualifying minimum (162 × 3.1 = 502.2, rounded to 502), the 2.7 Minor League figure, and the worked example printing .365 for 165 hits in 452 at-bats against .362 for 181 hits in 500 at-bats — both reproduced as unit tests for this calculator.
- [4]Major League Baseball. Official MLB Glossary, "Batting Average (AVG)": hits divided by total at-bats, the recent league-wide figure of roughly .250, batting average against for pitchers, and the note that for one season in 1887 walks counted as hits.
- [5]Major League Baseball. Official MLB Glossary, "At-bat (AB)": "An official at-bat comes when a batter reaches base via a fielder's choice, hit or an error (not including catcher's interference) or when a batter is put out on a non-sacrifice", and the note that at-bats are the denominator for both batting average and slugging percentage.
- [6]Major League Baseball. Official MLB Glossary, "Rate Stats Qualifiers": the current 3.1 PA per scheduled game standard, in force since 1957 for batters, and the earlier standards (60% of scheduled games 1876–1919, 100 games 1920–1949, 400 at-bats 1950–1956).
- [7]MLB Stats API (statsapi.mlb.com), season hitting statistics for player 677951 (Bobby Witt Jr.), 2024: 636 at-bats, 211 hits, published avg ".332". Source of the worked example on this page.
In this category
Embed
Quanta Pro
Paid features are coming later.
- All 590 calculators remain free
- No billing is enabled