Quick answer
On-base percentage = (hits + walks + hit by pitch) ÷ (at-bats + walks + hit by pitch + sacrifice flies). 150 hits, 60 walks, 5 HBP, 500 at-bats and 6 sacrifice flies give 215 ÷ 571 = .377.
Enter hits, walks, hit by pitch, at-bats and sacrifice flies. The calculator returns OBP.
Related tools: Winning Percentage Calculator: Winning percentage from wins, losses and ties. Slugging Percentage Calculator: Baseball slugging percentage from hit types and at-bats. Basketball Shooting Percentage Calculator: Field-goal, effective field-goal and three-point percentages.
How to use the On-Base Percentage Calculator
- Enter hits (a whole number, 0 or more).
- Enter walks (a whole number, 0 or more).
- Enter hit by pitch (a whole number, 0 or more).
- Enter at-bats (a whole number, 0 or more).
- Enter sacrifice flies (a whole number, 0 or more).
- Press Calculate to see the result, and use Reset to start again.
| Input | What to enter | Allowed values |
|---|---|---|
| Hits | A whole number | ≥ 0 |
| Walks | A whole number | ≥ 0 |
| Hit by pitch | A whole number | ≥ 0 |
| At-bats | A whole number | ≥ 0 |
| Sacrifice flies | A whole number | ≥ 0 |
Formula and method
Formula
OBP = (H + BB + HBP) ÷ (AB + BB + HBP + SF)
IEEE-754 double precision; shown to the decimals indicated.
Plate appearances that count toward on-base percentage. Informational estimate, not medical advice. Talk to a qualified health professional about your own situation.
Worked examples
These examples are verified: each one is an automated test case that the live calculator must reproduce exactly.
Example 1
Inputs: Hits = 150; Walks = 60; Hit by pitch = 5; At-bats = 500; Sacrifice flies = 6.
| Result | Value |
|---|---|
| On-base percentage | 0.377 |
Example 2
Inputs: Hits = 100; Walks = 40; Hit by pitch = 0; At-bats = 400; Sacrifice flies = 3.
| Result | Value |
|---|---|
| On-base percentage | 0.316 |
The first line is the headline result (on-base percentage). IEEE-754 double precision; shown to the decimals indicated.
Why OBP matters
OBP counts walks as well as hits, so it measures how often a batter reaches base. An OBP of .377 is excellent; the MLB average is about .320. Along with slugging percentage it forms OPS.
Denominator
The denominator is not simply at-bats; it adds walks, hit-by-pitch and sacrifice flies. Sacrifice bunts are excluded. The denominator must be above zero.
How the result changes with hits
Holding every other input at the first worked example, this table changes only hits. It shows how sensitive the answer is to that one value; each row was produced by running this calculator.
| Hits | On-base percentage |
|---|---|
| 75 | 0.245 |
| 150 | 0.377 |
| 300 | 0.639 |
| 600 | 1.165 |
What happens with invalid input
These messages are produced by the calculator itself, so you know what to fix.
- At-bats: entering "0" shows "Enter at least one plate appearance." beside that field and no result.
- Hits: entering "-1" shows "Hits must be at least 0." beside that field and no result.
Choosing between the On-Base Percentage Calculator and similar calculators
Each row shows what a related calculator on this site asks for and what it returns, so you can pick the one that matches your question.
| Calculator | You enter | It returns |
|---|---|---|
| [Winning Percentage Calculator](/fitness/winning-percentage/) | wins, losses and ties count as | Winning percentage |
| [Slugging Percentage Calculator](/fitness/slugging-percentage-calculator/) | singles, doubles and triples | Slugging percentage |
| [Basketball Shooting Percentage Calculator](/fitness/basketball-shooting-percentage-calculator/) | field goals made and field goals attempted | Field goal % |
| [Tennis Win Percentage Calculator](/fitness/tennis-win-percentage-calculator/) | matches won and matches lost | Win percentage |
| [Golf Handicap Calculator](/fitness/golf-handicap-calculator/) | adjusted gross scores, course rating for each score and slope rating for each score | Handicap Index |
Background: fitness estimates
Fitness formulas are estimates whose accuracy depends on the input. One-rep-max formulas such as Epley and Brzycki give different answers, and predictions from hard sets of a few repetitions are better than from sets of ten or more. Age-based maximum heart rate formulas can be off by 10 to 30 beats a minute for an individual; Tanaka's 208 − 0.7 × age is generally preferred to 220 − age but is still an estimate.
Pace models built from a race result assume a maximal effort and work best for distances from about 5 km to the marathon. Use the output as a guide, not a prescription.
Assumptions and limitations
- Denominator must be above zero
- Not a diagnosis
Estimates from formulas describe averages. They are not a training or medical prescription; check with a qualified professional before changing your exercise or diet.
If a required value is empty, not a number, or outside its allowed range, the form marks that field with a message and shows no result instead of a misleading number. The automated checks deliberately try invalid entries for at-bats and hits to confirm this.
Frequently asked questions
What is a good OBP?
Above .350 is very good.
What is OPS?
OPS is on-base percentage plus slugging percentage, e.g. .377 + .454 = .831.
Do errors count?
No, reaching on an error is an out for OBP.
What does the On-Base Percentage Calculator calculate?
Baseball on-base percentage. It returns On-base percentage.
What formula does the On-Base Percentage Calculator use?
OBP = (H + BB + HBP) ÷ (AB + BB + HBP + SF). Plate appearances that count toward on-base percentage.
What do I need to enter in the on-Base Percentage Calculator?
You enter Hits, Walks, Hit by pitch, At-bats and Sacrifice flies.
How is the result rounded or limited?
IEEE-754 double precision; shown to the decimals indicated. Denominator must be above zero.
What are the limits of this calculator?
Denominator must be above zero. Not a diagnosis.
What is an example of a on-Base Percentage result?
With hits 150, walks 60, hit by pitch 5, at-bats 500 and sacrifice flies 6, the on-base percentage is 0.377.
Where does the method come from?
The method follows: Official Baseball Rules, 9.02(a)(1).
Can I rely on this calculator for a decision?
Estimates from formulas describe averages. They are not a training or medical prescription; check with a qualified professional before changing your exercise or diet. For this calculator in particular: Denominator must be above zero.
Related calculators
- Winning Percentage Calculator — Winning percentage from wins, losses and ties.
- Slugging Percentage Calculator — Baseball slugging percentage from hit types and at-bats.
- Basketball Shooting Percentage Calculator — Field-goal, effective field-goal and three-point percentages.
- Tennis Win Percentage Calculator — Match win percentage.
- Golf Handicap Calculator — World Handicap System index from your recent scores.
- Batting Strike Rate Calculator — Cricket batting strike rate.
Sources
- Official Baseball Rules, 9.02(a)(1)
Content last reviewed 2026-11-04. Formulas and worked examples are checked by automated tests against independently computed values.