Baseball Batting Average, OBP and SLG Calculator
Baseball Batting Average, OBP and SLG Calculator
Baseball’s batting average is hits divided by at-bats, so it cannot leave the range .000 to 1.000 — it is not cricket’s batting average, which is runs per dismissal and has no upper bound. On-base percentage is also here, with the denominator that is not at-bats.
Batting average, OBP, SLG and OPS
Hits ÷ at-bats170 hits in 550 at-bats, 281 total bases, 60 walks, 8 hit by pitch, 5 sacrifice flies
Four formulas, three denominators, one rule number
OBP = (H + BB + HBP) ÷ (AB + BB + HBP + SF)
SLG = TB ÷ AB
OPS = OBP + SLG
- AVG, Rule 9.21(b)
- hits divided by times at bat. Because every hit is also an at-bat, the fraction is trapped between .000 and 1.000 — MLB’s glossary says so in those words. This page refuses a figure with more hits than at-bats rather than printing a number above one
- OBP, Rule 9.21(f)
- the denominator is at-bats PLUS walks PLUS hit-by-pitches PLUS sacrifice flies. It is not at-bats, and not quite plate appearances either, because sacrifice bunts and catcher’s interference are plate appearances this denominator leaves out
- SLG, Rule 9.21(c)
- total bases on safe hits divided by at-bats. A home run is worth four, which is why slugging percentage can exceed 1.000 and a batting average cannot, and it counts no walk and no hit by pitch at all
- OPS, and what is NOT in any of them
- the plain sum of the two fractions above — and they have DIFFERENT denominators, 623 against 550 in the default line, so OPS is not a rate and has no interpretation beyond “bigger is better”. None of the four contains any notion of being not out: cricket’s batting average withholds the denominator for an unfinished innings, and baseball has no such concept, because an at-bat always ends. That is why one average is bounded and the other is not
Worked example
170 hits in 550 at-bats, 281 total bases, 60 walks, 8 hit by pitch, 5 sacrifice flies
Batting average = 170 ÷ 550 = .309
Slugging percentage = 281 ÷ 550 = .511. The 281 total bases are 170 hits plus 111 extra bases, which is the only decomposition total bases alone supports — the counts of doubles, triples and home runs cannot be recovered from it
On-base percentage = (170 + 60 + 8) ÷ (550 + 60 + 8 + 5) = 238 ÷ 623 = .382. Divide the same 238 by at-bats alone and you get .433, 51 points too high — the single error this page exists to stop
OPS = .511 + .382 = .893, a sum of a fraction over 550 and a fraction over 623, which is why it is a score rather than a rate
Add 40 more walks and the batting average does not move at all: 170 ÷ 550 is still .309, while OBP RISES to 278 ÷ 663 = .419. Walks are invisible to one and decisive for the other
Set the at-bats to 0 and the page returns nothing rather than a zero, because hits per no at-bats does not exist
One phrase, two sports, two incompatible measurements
| Baseball batting average | Cricket batting average | |
|---|---|---|
| Numerator | hits | runs |
| Denominator | at-bats | dismissals (innings minus not-outs) |
| Range | .000 to 1.000, and it cannot leave it | zero upwards, with no ceiling |
| Printed as | three decimals with the leading zero dropped: .309 | two decimals: 57.14 |
| A typical good figure | about .300 | about 50 |
| Undefined when | there have been no at-bats | there have been no dismissals, which happens often |
| Defined by | Rule 9.21(b), Official Baseball Rules | nobody — it is a statistical convention, not a rule |
The same 238 times on base, over four denominators
| Denominator | What it is | Result | Verdict |
|---|---|---|---|
| 550 | at-bats alone | .433 | wrong — the commonest on-base error there is |
| 610 | at-bats plus walks | .390 | wrong — hit-by-pitches and sacrifice flies still missing |
| 618 | at-bats plus walks plus hit-by-pitches | .385 | wrong — sacrifice flies still missing |
| 623 | at-bats plus walks plus hit-by-pitches plus sacrifice flies | .382 | correct, under Rule 9.21(f) |
Which batting average this is, and the denominator most people get wrong
Two sports use the phrase “batting average” for two incompatible measurements, and this is the baseball one: hits divided by at-bats, a proportion that cannot leave the interval from .000 to 1.000. Cricket’s batting average is runs divided by DISMISSALS, has no upper bound at all, and is undefined for a batter who has never been out — 300 runs with one dismissal is an average of 300. They share a name and nothing else: not the numerator, not the denominator, not the units, not the range. If you arrived here for the cricket statistic, the cricket batting strike rate and average calculator is the page you want, and it sets out the not-out rule in full.
Rule 9.21 of Major League Baseball’s Official Baseball Rules, 2024 Edition, is the one place these percentages are defined by the body that runs the competition rather than by statistical custom. It sets out winning percentage at 9.21(a), batting average at (b), slugging percentage at (c), fielding average at (d), earned-run average at (e) and on-base percentage at (f). Batting average is hits divided by times at bat and nothing else. Every hit is also an at-bat, so the fraction can never exceed one; MLB’s glossary puts the range as “between zero (shown as .000) and one (1.000)”. This page refuses rather than printing an impossible figure if you enter more hits than at-bats, and refuses rather than printing a zero if the at-bats are zero.
The on-base denominator is where the real mistakes happen. Dividing by at-bats alone — much the commonest error — gives .433 instead of .382 on the line loaded above, and it is always an overstatement, because every term the wrong denominator omits is positive. It is also not quite plate appearances, although MLB’s glossary says “per plate appearance”: the same entry notes that “sacrifice bunts are removed from the equation entirely”, and a sacrifice bunt is a plate appearance. Where MLB’s glossary and MLB’s rulebook read differently, this page follows the rulebook and says so.
OPS adds two fractions that do not have the same denominator. On the default line, slugging is over 550 at-bats and on-base over 623, so the sum is of two rates measured against different bases. That is mathematically improper: the result is not a rate, not a percentage and not a weighted average of its inputs, and the only honest reading of it is ordinal. There is a second objection — on-base percentage is worth more per point than slugging, and OPS weights them equally. MLB’s glossary states neither; it says only that OPS “adds on-base percentage and slugging percentage to get one number that unites the two”. The statistic built to fix both faults is wOBA: one denominator, and a separate published weight for each kind of hit. It has its own page, the wOBA calculator, and the pitching equivalents of this one are the ERA calculator and the WHIP and pitching rates calculator.
Frequently asked questions
How do you calculate batting average in baseball?
Hits divided by at-bats — Rule 9.21(b) of the Official Baseball Rules. 170 hits in 550 at-bats is .309. At-bats, not plate appearances: walks, hit-by-pitches and sacrifices are excluded from both halves, which is why a batting average says nothing about how often a batter walks.
Is baseball’s batting average the same as cricket’s?
No, and not even the same shape. Baseball’s is hits per at-bat and is trapped between .000 and 1.000. Cricket’s is runs per dismissal, has no ceiling, and does not exist for a batter who has never been out — 300 runs with one dismissal is an average of 300.
Why is my on-base percentage wrong?
Almost always because at-bats were used as the denominator. Rule 9.21(f) wants at-bats plus walks plus hit-by-pitches plus sacrifice flies — 623 rather than 550 on the default line, where the wrong divisor gives .433 against the correct .382. The error is always too high and grows with the walks.
Can a batting average be higher than 1.000?
No. A hit is an at-bat, so the numerator can never exceed the denominator. Slugging percentage is a different matter and routinely exceeds 1.000, because a home run contributes four bases against one at-bat.
What is wrong with OPS?
It adds two fractions that do not share a denominator — on-base over 623 plate appearances and slugging over 550 at-bats, on the line above — so the sum is not a rate and has no direct interpretation. It also weights on-base and slugging equally when a point of on-base is worth more. wOBA exists because of both faults.
Related calculators
References
- Official Baseball Rules, Rule 9.21, Determining Percentage Records — (a) winning percentage; (b) batting average, hits ÷ times at bat; (c) slugging percentage, total bases on safe hits ÷ at-bats; (d) fielding average, putouts plus assists ÷ total chances (putouts, assists, errors); (e) earned-run average, earned runs × 9 ÷ innings pitched, with a Comment working 3 earned runs in 9 1/3 innings as 2.89; (f) on-base percentage, hits plus walks plus hit-by-pitches ÷ at-bats plus walks plus hit-by-pitches plus sacrifice flies. Read on baseballrulesacademy.com, 12 Oct 2026: the official 2024 Edition PDF was fetched whole and its extracted text of 109,942 characters stops inside Rule 5.09, while its own contents page lists Rule 9.21 on page 141. Every formula taken from it is corroborated against MLB’s glossary.
- Major League Baseball. Glossary: Batting Average (AVG) — “batting average is determined by dividing a player’s hits by his total at-bats”, “for a number between zero (shown as .000) and one (1.000)”; it “doesn’t take into account the number of times a batter reaches base via walks or hit-by-pitches” or “hit type”. mlb.com (read 12 Oct 2026).
- Major League Baseball. Glossary: On-base Percentage (OBP) — times on base “include hits, walks and hit-by-pitches” and exclude errors, fielder’s choice and a dropped third strike, while “sacrifice bunts are removed from the equation entirely”. The entry calls OBP a per-plate-appearance rate, which is looser than Rule 9.21(f): removing sacrifice bunts means the denominator is not plate appearances. mlb.com (read 12 Oct 2026).
- Major League Baseball. Glossary: Slugging Percentage (SLG) — “the total number of bases a player records per at-bat”, as “(1B + 2Bx2 + 3Bx3 + HRx4)/AB”; it “deals only with hits and does not include walks and hit-by-pitches in its equation”. mlb.com (read 12 Oct 2026).
- Major League Baseball. Glossary: On-base Plus Slugging (OPS) — “OPS adds on-base percentage and slugging percentage to get one number that unites the two.” The entry states no shortcoming at all: it mentions neither the two different denominators nor the equal weighting, which is why this page says both in its own words. mlb.com (read 12 Oct 2026).
