Audited 28 Jul 2026·Last updated 28 Oct 2026·6 citations·Tier 1·0 uses

On-Base Percentage Calculator (OBP) — Sacrifice Flies Handled Correctly

On-base percentage from hits, walks, hit-by-pitches, at-bats and sacrifice flies under Rule 9.21(f), with plate appearances and batting average for comparison.

On-Base Percentage Calculator

Singles, doubles, triples and home runs. Reaching base on an error, a fielder's choice or a dropped third strike is not a hit and is not a time on base.
At-bats, not plate appearances. Rule 9.02(a)(1) already removes walks, hit-by-pitches, both kinds of sacrifice and interference awards from this figure.
Include intentional walks — Rule 9.21(f) makes no distinction between them and any other base on balls.
Counts in both the numerator and the denominator, exactly like a walk.
These DO count in the denominator and will lower the result. A sacrifice fly is invisible to batting average but visible to on-base percentage — that asymmetry is in the rulebook, not an oversight.
These do NOT count in the denominator and cannot change the result. The field is here so you can see the difference between the OBP denominator and plate appearances.
Catcher's interference, obstruction and shift-restriction awards. Rule 9.21(f) Comment says to ignore these when computing on-base percentage — they count as plate appearances only.
On-base percentage
0.458
(H + BB + HBP) ÷ (AB + BB + HBP + SF) as Rule 9.21(f) defines it: the share of countable plate appearances in which the batter reached base.
Times on base
322
OBP denominator
703
Plate appearances
704
Batting average
0.322
OBP minus batting average
0.136

Background.

A sacrifice fly that brings a runner home from third leaves the hitter's batting average untouched and lowers his on-base percentage. A sacrifice bunt that moves a runner up to second touches neither. Both quirks come straight from the rulebook, and they are where most home-made OBP calculations go wrong.

Official Baseball Rule 9.21(f) defines on-base percentage in one sentence: the sum of hits, bases on balls and times hit by pitch, divided by the sum of at-bats, bases on balls, times hit by pitch and sacrifice flies. The top counts the ways a hitter reached base by his own doing. The bottom counts the plate appearances charged to him, which includes the sacrifice fly, because the batter made an out, but leaves out the sacrifice bunt, which MLB's glossary describes as usually a manager's strategic choice rather than the hitter's. The Comment to the same rule adds a third exclusion: when a batter is awarded first base for catcher's interference, obstruction or a shift-restriction violation, the plate appearance is ignored altogether.

That makes the OBP denominator smaller than plate appearances, and the difference can reach the third decimal. Aaron Judge's 2024 line in MLB's own statistics feed has 322 times on base against a denominator of 703, for .458. His plate appearances were 704, because one catcher's interference award counts there; dividing by 704 gives .457.

The statistic matters because of outs. A team has 27 of them in a nine-inning game, and a hitter who avoids making one has done the most basic job a batter has, whether by single, walk or a pitch in the ribs. Batting average ignores walks entirely, so two hitters with identical averages can reach base at very different rates. Alongside on-base percentage you get batting average and the gap between them, plus times on base, the denominator and plate appearances, so you can see exactly where each number comes from.

What is on-base percentage calculator?

On-base percentage (OBP), also called on-base average, is the fraction of a batter's countable plate appearances in which he reached base by a hit, a walk or being hit by a pitch: (H + BB + HBP) ÷ (AB + BB + HBP + SF). It is written like batting average, as a three-decimal figure with the leading zero dropped, so .458 means 45.8%. Reaching on an error, a fielder's choice or a dropped third strike does not count, because in each case the batter did not earn the base; MLB's glossary lists all three exclusions. Branch Rickey and the statistician Allan Roth devised the measure in the 1940s and 1950s, and it became an official statistic in 1984. Because it records only whether the batter reached, not how far, it is paired with slugging percentage, and the two added together make OPS.

How to use this calculator.

  1. Copy hits and official at-bats from a box score or season line. At-bats already exclude walks, hit-by-pitches, sacrifices and interference awards, so do not subtract them yourself.
  2. Enter walks with intentional walks included. The rule draws no distinction, and standard walk totals already count intentional walks.
  3. Enter hit-by-pitches; each one adds one to the top of the fraction and one to the bottom, exactly as a walk does.
  4. Enter sacrifice flies, which go into the denominator only, and sacrifice bunts (often listed as SH), which go into neither term. A combined "sacrifices" column cannot be used as it stands; the two have to be split.
  5. Enter times awarded first base on catcher's interference or obstruction. They leave OBP unchanged but add to plate appearances, which is why that output can differ from the OBP denominator.
  6. Read OBP, then the batting average and the gap between them, which shows how much of the hitter's on-base rate comes from walks and hit-by-pitches.

The formula.

OBP = (H + BB + HBP) ⁄ (AB + BB + HBP + SF)

OBP = (H + BB + HBP) ÷ (AB + BB + HBP + SF). The numerator, times on base, has three terms. The denominator starts from at-bats, which Rule 9.02(a)(1) already strips of walks, hit-by-pitches, sacrifices and interference awards, then adds the walks and hit-by-pitches back so that every time on base is also counted as an opportunity, and adds sacrifice flies as opportunities that ended without the batter reaching.

Plate appearances, as Rule 9.22(a) defines them, are AB + BB + HBP + SF + SH + interference awards. So plate appearances minus the OBP denominator is exactly the number of sacrifice bunts plus interference awards. For a power hitter who never bunts that difference is usually zero or one; for a light-hitting infielder in a bunt-heavy era it could run into double figures.

Each input's effect follows from where it sits. Walks and hit-by-pitches appear in both terms, so each one pulls OBP towards 1.000. A hit adds one to the top while its at-bat adds one to the bottom, so it too pulls OBP upward. Sacrifice flies sit underneath only and always pull it down, as do outs of every kind, including times a batter reached on an error or a fielder's choice, since those are recorded as at-bats without a hit. Sacrifice bunts and interference awards sit in neither term. Late in a season single plate appearances still register in the third decimal: at Judge's 2024 totals, one more walk would lift his OBP from .4580 to 323 ÷ 704 = .4588, and one more out would drop it to 322 ÷ 704 = .4574.

Batting average is H ÷ AB, and the gap, OBP − AVG, isolates the contribution of free passes less the small drag of sacrifice flies. Every count must be a whole number, at-bats must be at least one so that batting average exists, and hits cannot exceed at-bats.

A worked example.

Example

Aaron Judge's 2024 season, as MLB's statistics feed records it: 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. Times on base are 180 + 133 + 9 = 322. The Rule 9.21(f) denominator is 559 + 133 + 9 + 2 = 703. Dividing, 322 ÷ 703 = 0.4580, which prints as .458, the figure MLB publishes. Plate appearances are 703 + 0 + 1 = 704, because the interference award counts there even though the rule's Comment excludes it from OBP; 322 ÷ 704 would have given 0.4574, or .457. His batting average was 180 ÷ 559 = 0.3220, so the gap between the two rates is 0.4580 − 0.3220 = 0.1360, or 136 points. Almost all of it comes from his 142 walks and hit-by-pitches, which batting average does not register at all.

hits180
sacrifice Flies2
walks133
sacrifice Bunts0
catchers Interference1
hit By Pitch9
at Bats559

Frequently asked questions.

Does a sacrifice fly count against on-base percentage?
Yes. A sacrifice fly is not an at-bat, so it leaves batting average alone, but Rule 9.21(f) lists sacrifice flies as the fourth term of the OBP denominator, so each one lowers on-base percentage. MLB's glossary states the asymmetry outright. The reasoning is that the batter tried to reach base and did not; the run that scored does not change that. Had Judge hit eight more sacrifice flies in 2024, his OBP would have fallen from .458 to 322 ÷ 711 = .453.
Do sacrifice bunts lower on-base percentage?
No. A sacrifice bunt is not an at-bat under Rule 9.02(a)(1) and is not among the four denominator terms in Rule 9.21(f), so it drops out of OBP entirely. MLB's glossary explains that a bunt is rarely the hitter's own decision and usually a manager's strategic call. A batter with 20 sacrifice bunts in a season has exactly the OBP he would have with none; the bunts appear only in his plate appearances.
Why is the OBP denominator smaller than plate appearances?
Because plate appearances, as Rule 9.22(a) defines them, also include sacrifice bunts and times awarded first base for interference, obstruction or a shift-restriction violation, and on-base percentage leaves both out. The difference is usually small but can move the third decimal: Judge's 322 times on base over 703 is .4580, over his 704 plate appearances .4574, and those round to .458 and .457. Dividing by plate appearances is the most frequent error in hand-made OBP figures.
Does reaching base on an error count as getting on base?
No. MLB's glossary excludes errors, fielder's choices and dropped third strikes from times on base, because in each case the batter's own result was, or should have been, an out. The at-bat is still charged, so each of these lowers OBP even though the batter ends up standing on first. Catcher's interference is handled differently: the rule's Comment says to ignore it, so it neither helps nor hurts.
Are intentional walks included in OBP?
Yes. Rule 9.21(f) refers to bases on balls without singling out the intentional kind, and standard walk totals already include them, so enter the full figure. Hitters who are often walked on purpose, usually because pitchers fear them, therefore get an OBP boost that reflects how opponents chose to pitch to them as much as their own judgement of the strike zone.
What is a good on-base percentage?
Judge it against its league and season, because the baseline moves with the run environment. In recent major league seasons the overall figure has sat between about .310 and .320, so a mark in the .350s is well above average and .400 or better is rare over a full season. The highest career on-base percentage in major league history is Ted Williams's .482. Be wary of small samples: in 50 plate appearances, each extra time on base moves OBP by .020.
Why do analysts rate OBP above batting average?
Because outs are the one resource an offence cannot replace: a team gets 27 in a nine-inning game, and every plate appearance that does not use one keeps the inning going. Batting average counts only at-bats and treats a walk as if the plate appearance never happened. Two .270 hitters with 135 hits in 500 at-bats, 5 hit-by-pitches and 5 sacrifice flies differ sharply if one walks 30 times and the other 90: their OBPs are .315 and .383, 69 points apart.
How many plate appearances does a player need to qualify for the on-base title?
3.1 per scheduled team game, the same standard as the batting title: Rule 9.22(a) names the batting, slugging and on-base percentage championships together. In a 162-game season that is 162 × 3.1 = 502.2, which comes to 502. The qualifier is counted in plate appearances even though the OBP denominator is not, because it measures playing time rather than the statistic itself.
Can on-base percentage be lower than batting average?
Only when sacrifice flies outweigh walks and hit-by-pitches. A hitter with 3 hits in 10 at-bats, no walks, no hit-by-pitches and one sacrifice fly bats .300 but has an OBP of 3 ÷ 11 = .273. Over a full season it essentially never happens, because almost every hitter walks more often than he hits sacrifice flies, so a negative gap in the results usually means a walk total went into the wrong box.
How far back can on-base percentage be calculated?
As far back as hits, walks and hit-by-pitches were recorded, but the sacrifice fly is the weak link. MLB's glossary dates it as an official rule from 1954, and earlier records do not always separate sacrifice flies from sacrifice bunts, so the fourth denominator term cannot always be recovered. OBP itself became an official statistic only in 1984; figures for earlier seasons are reconstructions, with a small uncertainty wherever sacrifice flies cannot be told apart.

References& sources.

  1. [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. [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. [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. [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. [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. [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 two independent checks of this calculator.

How this page was produced

Published by
Quanta Calculator
Primary sources
6 cited below
Method
OBP = (H + BB + HBP) ⁄ (AB + BB + HBP + SF)
Published
Last verified

Built with AI assistance and verified by automated tests against the cited sources — every worked example on this page is computed by the same code that runs the calculator. How we build and check calculators.

In this category

Embed

Quanta Pro

Paid features are coming later.

  • All 1560 calculators remain free
  • No billing is enabled
Coming soon