Baseball On-Base Percentage Calculator

Calculate OBP, SLG, and OPS from a player's batting line.

Enter at-bats, hits, doubles, triples, home runs, walks, hit-by-pitches, and sacrifice flies to compute On-Base Percentage, Slugging, and OPS using the official MLB formulas. Runs in your browser.

What is On-Base Percentage?

On-Base Percentage measures how often a batter reaches base via a hit, walk, or hit-by-pitch. It is calculated as (H + BB + HBP) divided by (AB + BB + HBP + SF) and is a better measure of offensive value than batting average because it counts walks.

Batting average undersells patient hitters by ignoring walks. On-Base Percentage and Slugging together — summarised as OPS — give a far truer picture of offensive value. This calculator applies the exact MLB formulas, including the subtle role of sacrifice flies in the OBP denominator.

How it works

The three statistics build on each other from a single batting line:

OBP = (H + BB + HBP) / (AB + BB + HBP + SF)
TB  = singles + 2×doubles + 3×triples + 4×home runs
SLG = TB / AB
OPS = OBP + SLG

Singles are derived as hits minus the extra-base hits, so you only enter total hits plus the doubles, triples, and home runs. Sacrifice flies count in the OBP denominator but never as at-bats.

Example and tips

A batter with 400 at-bats, 130 hits (28 doubles, 3 triples, 22 home runs), 60 walks, 5 hit-by-pitches, and 6 sacrifice flies has an OBP of (130 + 60 + 5) / (400 + 60 + 5 + 6) = 195 / 471 ≈ .414, total bases of 231, a SLG of .578, and an OPS near .992 — an elite season. Make sure your extra-base-hit counts never exceed total hits, or the singles figure goes negative.