On-Base Percentage Calculator (OBP) — Sacrifice Flies Handled Correctly
Free OBP calculator using Official Baseball Rule 9.21(f). Sacrifice flies count in the denominator, sacrifice bunts do not — most calculators get this wrong.
On-Base Percentage Calculator
Background.
On-base percentage answers the only question that matters at the plate: how often does this hitter avoid making an out? Official Baseball Rule 9.21(f) gives the formula in one sentence — divide the sum of hits, bases on balls and times hit by pitch by the sum of at-bats, bases on balls, times hit by pitch and sacrifice flies. Four terms on the bottom. Not three, not five, and emphatically not plate appearances.
That denominator is the entire reason this page exists, because two of its details are wrong in most on-base percentage calculators on the internet. The first is the sacrifice fly. A sacrifice fly is not an at-bat, so it does not touch batting average at all — but Rule 9.21(f) names it explicitly as the fourth denominator term, so it does lower on-base percentage. MLB's own glossary states the asymmetry in as many words: a sacrifice fly "does not count against a player's batting average… However, sacrifice flies count against a player's on-base percentage." The second is the sacrifice bunt, which is the mirror image: it is not an at-bat and it is not one of the four terms, so it disappears from on-base percentage entirely. MLB's glossary explains the logic — "it is rarely a hitter's decision to sacrifice himself, but rather a manager's choice as part of an in-game strategy". Two kinds of sacrifice, two opposite treatments, and a calculator that lumps them together is wrong about one of them.
The third trap is subtler and costs a full point of on-base percentage. Plate appearances and the on-base denominator are not the same number. Rule 9.22(a) defines a plate appearance as at-bats plus walks plus hit-by-pitches plus sacrifice hits plus sacrifice flies plus times awarded first base on interference, obstruction or a shift-restriction violation. That is two terms more than the OBP denominator, and Rule 9.21(f)'s own Comment instructs the scorer to ignore interference awards specifically when computing on-base percentage. Aaron Judge reached base 322 times in 2024 against a denominator of 703, which is .458. Divide the same 322 by his 704 plate appearances and you get .457. One catcher's interference award in an entire season, one point of on-base percentage. This calculator asks for sacrifice bunts and interference awards precisely so it can show you both numbers side by side and prove they differ.
The statistic itself is younger than the game by seventy years. MLB's glossary credits its invention to Dodgers executive Branch Rickey and statistician Allan Roth in the 1940s and 50s, and records that it did not become an official statistic until 1984 — which is why on-base percentage before the mid-1950s has to be reconstructed, and why sacrifice-fly data before 1954, when the category was formally separated from the sacrifice bunt, is patchy. The page reports batting average alongside on-base percentage and the gap between them, because that gap is the whole argument. A hitter batting .322 with a .458 on-base percentage has 136 points of value that batting average cannot see, all of it in walks and hit-by-pitches, all of it invisible to the statistic most fans still quote first.
Below the widget you will find the rule text verbatim, the full list of what does and does not count as a time on base, a worked example reproducing a Most Valuable Player season from official MLB data — including the interference award that moves the answer — two further published seasons as independent checks, the qualifying rule for the on-base title, and an honest account of what on-base percentage still misses, which is everything about what happens after the hitter reaches.
What is on-base percentage calculator?
On-base percentage (OBP), also called on-base average, is the share of a hitter's qualifying plate appearances in which he reached base by hit, walk or hit-by-pitch. Official Baseball Rule 9.21(f) defines it as (H + BB + HBP) ÷ (AB + BB + HBP + SF). Unlike batting average it counts walks and hit-by-pitches, which is the point: from a run-scoring perspective a walk and a single put the same runner on the same base, and a hitter who draws 130 walks creates enormous value that batting average records as nothing at all. Three ways of reaching base are deliberately excluded — an error, a fielder's choice and a dropped third strike — because in each case the batter did not earn the base; MLB's glossary lists all three. So is a catcher's interference award, by explicit instruction in Rule 9.21(f)'s Comment. The scale runs from .000 to 1.000; the Major League average has sat near .312 to .320 in recent seasons, .350 is a strong regular, .400 is an elite season and only a handful of hitters in history have finished a career above .450. The same qualifying rule as the batting title applies: Rule 9.22(a) requires 3.1 plate appearances per scheduled team game, which is 502 in a 162-game season. Because OBP measures only the avoidance of outs, it says nothing about what kind of base was reached — that is slugging percentage's job, and the two are added together to form OPS.
How to use this calculator.
- Enter hits and official at-bats from the box score. At-bats already exclude walks, hit-by-pitches, both kinds of sacrifice and interference awards, so do not subtract anything yourself.
- Enter walks including intentional walks. The rule makes no distinction, and neither does this calculator.
- Enter hit-by-pitches. They behave exactly like walks: they add to both the top and the bottom of the fraction.
- Enter sacrifice flies carefully. These raise the denominator and lower the result. If your source lists only a combined 'sacrifices' column — common for pre-1954 data — you cannot split it, and the resulting OBP will be slightly too low.
- Enter sacrifice bunts and interference awards even though they cannot change the answer. They feed the plate-appearance output, which exists so you can see with your own eyes that plate appearances and the OBP denominator are different numbers.
- Read the gap between on-base percentage and batting average at the bottom. Around .060 to .070 is ordinary; above .100 marks a genuinely selective hitter; below .050 usually means a free swinger whose batting average is carrying his entire offensive case.
The formula.
The numerator is easy and the denominator is where every mistake lives.
Numerator: hits plus walks plus hit-by-pitches. Three ways of reaching base, and only three. An error is not one of them, because the batter made an out that a fielder failed to convert. A fielder's choice is not one, because a runner was retired on the play. A dropped third strike is not one, because the batter struck out. MLB's glossary lists all three exclusions explicitly. In every one of those cases the hitter ends up standing on first base and his on-base percentage does not move.
Denominator: at-bats plus walks plus hit-by-pitches plus sacrifice flies. Read it as 'every plate appearance in which the hitter was responsible for the outcome'. A walk and a hit-by-pitch are added back in — they were removed from at-bats, and on-base percentage wants them. A sacrifice fly is added back in because, although the manager may have wanted a fly ball, the hitter still failed to reach base and a run scored regardless. A sacrifice bunt is not added back in because it is a called play the hitter did not choose. An interference award is not added back in by explicit instruction in the rule's own Comment.
Why that matters arithmetically: plate appearances exceed the on-base denominator by exactly the number of sacrifice bunts plus interference awards. For a modern power hitter who never bunts, that difference is zero or one — and a difference of one is enough to move a season on-base percentage by a full point, because the denominator is around 700 and one part in 700 is 0.0014. The calculator shows both numbers so the discrepancy is visible rather than mysterious.
The supporting outputs are simple algebra on the same inputs. Batting average is hits over at-bats. The difference between the two rates isolates the contribution of free passes: OBP − AVG is, to a very close approximation, (BB + HBP) divided by the on-base denominator, scaled by how much of the denominator those events represent. A hitter with 133 walks and 9 hit-by-pitches in 703 qualifying appearances carries a gap of .136, which is to say more than a hundred points of his ability to avoid an out are simply not in his batting average.
One precision note. Baseball prints on-base percentage to three decimals. Rounding intermediate values to three decimals and then subtracting produces visible error in the third place, so this calculator carries every intermediate at full precision and rounds once, at the display boundary.
A worked example.
Aaron Judge won the 2024 American League Most Valuable Player award with a season built almost as much on walks as on home runs. MLB's official data feed gives his line as 559 at-bats, 180 hits, 133 walks, 9 hit-by-pitches, 2 sacrifice flies, no sacrifice bunts — and one award of first base on catcher's interference. Numerator: 180 + 133 + 9 = 322 times on base. Denominator, per Rule 9.21(f): 559 + 133 + 9 + 2 = 703. Divide: 322 ÷ 703 = 0.458036984…, which the calculator returns as 0.4580369844 and MLB publishes as .458. Now look at the plate-appearance output: 704, because the interference award counts as a plate appearance even though Rule 9.21(f)'s Comment orders it ignored for on-base percentage. Divide 322 by 704 instead and you get .457 — a full point lower, from one plate appearance in a 158-game season. That is the error this page is built to prevent, and it is invisible unless you print both denominators. The contrast with batting average is the other story here. Judge hit .322, which is excellent; his on-base percentage was .458, which is historic. The 136-point gap between them is entirely walks and hit-by-pitches, and it is the single clearest illustration of why on-base percentage exists: a hitter who reaches base 322 times contributes far more than one who collects 180 hits, and only one of those two numbers is in his batting average.
Frequently asked questions.
What is the on-base percentage formula?
Does a sacrifice fly count against on-base percentage?
Do sacrifice bunts count in on-base percentage?
Is the OBP denominator the same as plate appearances?
Does reaching base on an error count in on-base percentage?
What is a good on-base percentage?
Why is on-base percentage considered more important than batting average?
How many plate appearances do you need to qualify for the on-base title?
Can on-base percentage be lower than batting average?
How far back does on-base percentage data go?
References& sources.
- [1]Office of the Commissioner of Baseball (2025). Official Baseball Rules, 2025 Edition, Rule 9.21(f) and Comment: "On-base percentage (or on-base average), divide the sum of hits, bases on balls and times hit by pitch by the sum of at-bats, bases on balls, times hit by pitch and sacrifice flies", and "For the purpose of computing on-base percentage, ignore instances of a batter being awarded first base on interference, obstruction, or shift restriction violation." This is the definition implemented here.
- [2]Office of the Commissioner of Baseball (2025). Official Baseball Rules, Rule 9.22(a): "Total appearances at the plate shall include official times at bat, plus bases on balls, times hit by pitcher, sacrifice hits, sacrifice flies and times awarded first base because of interference, obstruction, or shift restriction violation", together with the 3.1-per-scheduled-game qualifying standard. Source of the plate-appearance output and of the demonstration that PA is not the OBP denominator.
- [3]Major League Baseball. Official MLB Glossary, "On-base Percentage (OBP)": times on base "include hits, walks and hit-by-pitches, but do not include errors, times reached on a fielder's choice or a dropped third strike", the note that sacrifice bunts are removed from the equation entirely as a manager's choice, and the history — invented by Branch Rickey and Allan Roth in the 1940s–50s, official only from 1984.
- [4]Major League Baseball. Official MLB Glossary, "Sacrifice Fly (SF)": "A sacrifice fly does not count as an at-bat and therefore does not count against a player's batting average… However, sacrifice flies count against a player's on-base percentage", and the note that the sacrifice fly became an official rule in 1954.
- [5]Major League Baseball. Official MLB Glossary, "Plate Appearance (PA)" and "At-bat (AB)": plate appearance is every completed turn batting; at-bats are the denominator for batting average and slugging percentage; total plate appearances rather than at-bats determine who qualifies for the rate-statistic leaderboards.
- [6]MLB Stats API (statsapi.mlb.com), season hitting statistics for player 592450 (Aaron Judge), 2024: 559 at-bats, 180 hits, 133 walks, 9 hit-by-pitch, 2 sacrifice flies, 1 catcher's interference, 704 plate appearances, published obp ".458". Source of the worked example. The same endpoint for players 677951 and 660271 supplies the two independent checks used in this calculator's unit tests.
In this category
Embed
Quanta Pro
Paid features are coming later.
- All 590 calculators remain free
- No billing is enabled