Sports, Games, Gambling Odds & Hobbies Baseball & Softball Statistics MLB Official Baseball Rules, Rule 9.22

Batting Average Calculator

Enter hits and at-bats and this calculator returns batting average to three decimal places exactly as an official scorer would report it, along with plate appearances, the number of consecutive hits that would lift you to a target average, and the number of hitless at-bats that would drop you below it. Walks, hit-by-pitch and sacrifices are counted toward plate appearances but deliberately excluded from at-bats, which is the single rule that separates a correct average from a wrong one. It works for baseball, fastpitch and slowpitch softball, and any league that scores under the same rulebook.

Calculator

This calculator runs in your browser. Enable JavaScript for live results — the inputs, formula and worked example below remain fully readable without it.

Inputs this calculator takes, with typical values
InputWhat to enterExample
Hits (H)Every safe hit — singles, doubles, triples and home runs. Reached-on-error does not count.185
At-bats (AB)Plate appearances minus walks, hit-by-pitch, sacrifices and catcher's interference.456
Walks (BB)Bases on balls, including intentional walks. Used only for plate appearances, never for average.147
Hit by pitch (HBP)Times awarded first base after being struck by a pitch.3
Sacrifice flies (SF)Fly outs that score a runner. Charged as a plate appearance but not an at-bat.0
Sacrifice hits (SH)Sacrifice bunts. Also a plate appearance but not an at-bat.0
Target averageThe average you want to chase or defend, entered as a decimal such as 0.300.0.4

It returns

  • Batting average — Hits divided by at-bats, reported to three decimal places.
  • Plate appearances — AB + BB + HBP + SF + SH.
  • Consecutive hits to reach the target — Hits in as many consecutive at-bats. Zero means you are already at or above the target.
  • Hitless at-bats to fall below the target — Consecutive at-bats without a hit. Zero means you are already below the target.
  • At-bats per hit — The reciprocal of the average — how many trips it takes to produce one hit.

The formula

AVG=HAB
PA=AB+BB+HBP+SF+SH
k=tABH1t

In plain text: AVG = H / AB

  • AVGBatting average, reported to three decimal places (decimal)
  • HHits — singles, doubles, triples and home runs (count)
  • ABOfficial at-bats, excluding walks, hit-by-pitch and sacrifices (count)

Rule 9.22 of the Official Baseball Rules defines the batting champion by this ratio. Plate appearances are a separate count that includes the events removed from AB.

Updated Category Baseball & Softball Statistics Verified against published test cases Reading time 10 min

What batting average measures, and what it quietly ignores

Batting average is the share of official at-bats in which a hitter reaches base with a hit. It answers one narrow question — when this batter is charged with a turn at the plate, how often does the ball land safely? — and it answers it in the same three-decimal shorthand the game has used since the 1870s. A .300 hitter gets a hit in three of every ten at-bats. A .200 hitter gets one in five.

The denominator is where the statistic gets its character. An at-bat is not the same thing as a trip to the plate. When you walk, get hit by a pitch, lay down a sacrifice bunt, hit a sacrifice fly, or reach on catcher's interference, you have used a plate appearance but you are not charged with an at-bat. Those events vanish from the average entirely. That is why a patient hitter who walks 140 times can carry the same batting average as a free swinger who walks 20 times while being a vastly more productive offensive player, and it is why on-base percentage exists.

Two consequences follow immediately. First, batting average cannot be hurt by a walk — the plate appearance simply does not enter the calculation. Second, batting average treats a bunt single and a grand slam identically, because it counts hits rather than bases. Slugging percentage exists to fix that second blind spot.

The formula, term by term

Divide hits by at-bats. That is the whole calculation: AVG = H / AB. The difficulty is never the arithmetic, it is deciding what belongs in each term.

Hits (H) counts any ball on which the batter reaches base safely without the benefit of a fielding error, a fielder's choice, or an official-scorer ruling that another runner was retired on the play. Reaching on an error is an at-bat with no hit — one of the most common scorekeeping mistakes in youth leagues, where a ball that squirts under a glove is often written down as a single.

At-bats (AB) is derived by subtraction, not by counting. Take every plate appearance and remove the five categories the rules exclude: bases on balls, hit-by-pitch, sacrifice flies, sacrifice hits (bunts), and awards for catcher's or fielder's interference. What remains is the at-bat total. Strikeouts stay in. Reaching on an error stays in. A fielder's choice stays in.

The rules make one distinction that catches people out: a sacrifice bunt and a sacrifice fly both leave the at-bat total, so both are invisible to batting average, but only the bunt is also removed from the on-base percentage denominator. That single asymmetry is the reason the two statistics need separate inputs.

Because the ratio is reported to three decimals, the rounding rule matters at the margins. A hitter at 179-for-448 is batting .39955, which rounds to .400 — which is precisely why Ted Williams was invited to sit out the last day of the 1941 season.

Worked example: Ted Williams, 1941

Williams entered the final day of the 1941 season with 179 hits in 448 at-bats. Work it through the way the scorer would.

  1. Divide. 179 ÷ 448 = 0.399553.
  2. Round to three places. 0.399553 → .400. On the scoreboard he was a .400 hitter; in the ledger he was four ten-thousandths short.
  3. Play the doubleheader. He went 6-for-8, so hits become 179 + 6 = 185 and at-bats become 448 + 8 = 456.
  4. Recompute. 185 ÷ 456 = 0.405702 → .406.
  5. Add the plate appearances. Over the full season he drew 147 walks and was hit by 3 pitches, with no sacrifices charged, so PA = 456 + 147 + 3 = 606.
  6. Check the reciprocal. 456 ÷ 185 = 2.46 at-bats per hit — he needed fewer than two and a half official trips to produce a hit.

Now run the counterfactual the calculator gives you. Suppose he had sat at 179-for-448 and you set the target to .400. The hitless at-bats needed to fall below .400 is floor(179 ÷ 0.400 − 448) + 1 = floor(447.5 − 448) + 1 = floor(−0.5) + 1 = 0, floored at 1 — he was already below .400 on the exact figure, and one more hitless at-bat would only widen the gap. The rounding, not the arithmetic, was carrying him.

How to read the number you get

Read a batting average against its league and its era before you read it against a benchmark. In Major League Baseball the league-wide figure has spent most of the last century between .250 and .275, so .300 has stood as the traditional mark of an excellent contact hitter and .200 — the "Mendoza line" — as the point at which a position player's bat stops justifying the roster spot. In NCAA and high-school baseball, and in fastpitch softball, league averages run considerably higher, so a .300 average is ordinary rather than notable.

Sample size dominates everything early in a season. At 25 at-bats, one hit is worth 40 points of average; at 500 at-bats, it is worth two. This is why the Official Baseball Rules require 3.1 plate appearances per team game — 502 in a 162-game season — before a hitter qualifies for the batting title, and why comparing a 40-at-bat hot streak to a full-season line tells you almost nothing.

Finally, read the average alongside the walk rate. Two hitters at .270 are not equivalent if one has an on-base percentage of .400 and the other .295. The calculator reports plate appearances precisely so you can see how much of a hitter's contribution sits outside the batting-average denominator.

Hits required to reach a given average

Round up: hits are whole numbers, so the entry is the smallest hit total that reaches or exceeds the average at that at-bat count.
At-bats.250.275.300.325.350
1002528303335
2005055606570
30075839098105
400100110120130140
500125138150163175
600150165180195210

Each cell is the at-bat count multiplied by the target average and rounded up to the next whole hit.

Mistakes that produce a wrong batting average

  • Counting walks as at-bats. The most frequent error in youth and recreational scorekeeping, and it always depresses the average. A hitter with 30 hits in 100 at-bats and 20 walks is a .300 hitter, not a .250 hitter.
  • Scoring reached-on-error as a hit. It is an at-bat with no hit, so it pushes the average down. Official scorers award the error to the fielder; the batter gets nothing.
  • Leaving sacrifice flies in the at-bat total. A sacrifice fly is removed from AB, so counting it depresses the average. It is not removed from the on-base percentage denominator, which is where the two statistics part company.
  • Rounding to two decimals. Batting average is a three-decimal statistic. Reporting .30 instead of .303 throws away the precision that decides batting titles.
  • Comparing across leagues without context. A .320 average in a high-offence slowpitch softball league and a .320 average in a Division I conference are not the same accomplishment.
  • Reading a 20-at-bat sample as a skill level. Below roughly 100 at-bats the figure is dominated by sequencing luck and batted-ball placement rather than by hitting ability.

The governing rule

Batting average is defined in Rule 9.22 of the Official Baseball Rules published by the Office of the Commissioner of Baseball, which also sets the 3.1-plate-appearances-per-game qualification for a batting title and the procedure for charging a hitter with theoretical hitless at-bats when they fall short of that minimum. Softball bodies including USA Softball and the NCAA adopt the same H ÷ AB definition; the differences between codes are in what constitutes an at-bat under their sacrifice and courtesy-runner provisions, not in the ratio itself.

Where batting average sits among the modern measures

Batting average survives because it is legible, not because it is the best available measure of hitting. Every serious evaluation now pairs it with at least two companions. On-base percentage restores the walks and hit-by-pitch that AVG discards, and correlates far more strongly with run scoring. Slugging percentage restores the distinction between a single and a home run by counting total bases rather than hits. Added together they give OPS, the quick composite that most broadcasts now show beside the average.

Two derived quantities are worth knowing. Isolated power is slugging minus average, and strips out the singles to leave pure extra-base ability. Batting average on balls in play (BABIP) removes strikeouts and home runs from both terms and typically settles near .300 for a whole league, which makes it a useful check on whether a hot or cold stretch is being driven by contact quality or by where the fielders happened to be standing.

On the run-prevention side of the ledger the analogous single-number summaries are earned run average for pitchers and, in other sports, efficiency ratios built the same way — true shooting percentage in basketball and save percentage in hockey both divide a success count by a properly defined opportunity count, and both live or die on getting the denominator right, exactly as batting average does.

Key terms

At-bat (AB)
A plate appearance that does not end in a walk, hit-by-pitch, sacrifice, or interference award. It is the denominator of batting average.
Plate appearance (PA)
Every completed turn at the plate, regardless of outcome. Used as the denominator for rate statistics such as walk rate and strikeout rate.
Mendoza line
A .200 batting average, named for infielder Mario Mendoza and used as the informal threshold below which a position player's hitting is considered unplayable.
Qualified hitter
A batter with at least 3.1 plate appearances per team game — 502 in a 162-game season — which is the minimum for appearing on the official batting-average leaderboard.

Frequently asked questions

Do walks count in batting average?

No. A walk is not an official at-bat, so it never appears in either the numerator or the denominator of batting average — it leaves the figure completely unchanged. That is a deliberate feature of the rule, not an oversight: batting average is meant to measure hitting, and a walk involves no batted ball. Walks do count as plate appearances, and they do count in on-base percentage, which is why a patient hitter's OBP can sit 130 points above their average.

How do you calculate batting average by hand?

Divide hits by at-bats and round to three decimal places. For 47 hits in 168 at-bats, 47 ÷ 168 = 0.27976, so the average is .280. The only judgement involved is deciding the at-bat total: start from plate appearances and subtract walks, hit-by-pitch, sacrifice flies, sacrifice bunts, and any catcher's-interference awards. Everything else — strikeouts, ground-outs, fielder's choices, reached-on-error — stays in the denominator.

What is a good batting average?

In Major League Baseball, .300 is the traditional mark of an excellent hitter, .260 to .270 is roughly league average, and .200 is the floor below which a position player is considered unplayable on offence. Those thresholds do not transfer. NCAA baseball, high-school leagues and fastpitch softball all run higher league averages, so a .300 average there is unremarkable. Always compare a hitter to the league they actually play in.

Does a sacrifice fly lower your batting average?

No. A sacrifice fly is removed from at-bats, so it leaves batting average untouched. It does, however, stay in the denominator of on-base percentage, which means the same play lowers OBP while leaving AVG alone. A sacrifice bunt is removed from both. This asymmetry is written into the official rules and is the single most common reason a hand-calculated OBP disagrees with the published one.

How many hits do I need to raise my average to .300?

Set the target field to 0.300 and read the consecutive hits to reach the target output. The formula is (0.300 × AB − H) ÷ 0.700, rounded up, because every additional hit adds one to both the numerator and the denominator. At 27-for-100 you need 5 straight hits: 32 ÷ 105 = .305, whereas 4 straight leaves you at 31 ÷ 104 = .298. The required number grows quickly as at-bats accumulate.

Is batting average different in softball?

The formula is identical — hits divided by at-bats — and both USA Softball and the NCAA use it unchanged. What differs is the context: fastpitch and especially slowpitch leagues produce far more hits per at-bat, so league averages sit well above the baseball norm and the benchmarks shift with them. Some slowpitch leagues also treat courtesy runners and defensive substitutions differently, but none of that touches the ratio.

Why is batting average written with three decimals and no leading zero?

Convention, dating to nineteenth-century box scores, where dropping the leading zero saved a character in tightly set newspaper type. The value is a plain decimal fraction between 0 and 1, so .406 means 0.406 and is spoken as "four-oh-six". Three decimals is enough to separate players over a full season — the 1941 batting title turned on a difference of less than one thousandth.

What happens to my average if I have zero at-bats?

It is undefined, and this calculator returns a dash rather than zero. A hitter who has walked four times and bunted once has five plate appearances and no at-bats, so the ratio has no denominator. Reporting that as .000 would be wrong — it would imply five failed attempts to get a hit when there were none. Plate appearances are still counted and displayed.

References