UTILS.
100% in-browser

Batting Average, OBP, SLG & OPS Calculator

Turn a hitter's box-score line into batting average, on-base percentage, slugging, OPS, total bases and ISO, shown to three decimals baseball-style.

About this tool

The Batting Average, OBP, SLG & OPS Calculator converts a hitter's counting stats into the core rate statistics used across baseball. Enter at-bats (AB) directly, or switch to plate-appearance mode and let the tool derive AB = PA − BB − HBP − SF − SH. Add hits, doubles, triples, home runs, walks, hit-by-pitch, sacrifice flies and sacrifice hits, and it computes each average instantly.

The formulas follow the standard definitions. Batting average is BA = H/AB. On-base percentage is OBP = (H + BB + HBP) / (AB + BB + HBP + SF). Slugging is SLG = TB/AB, where total bases TB = 1B + 2·2B + 3·3B + 4·HR and singles are found as 1B = H − 2B − 3B − HR. OPS is simply OBP + SLG, and isolated power is ISO = SLG − BA, measuring extra-base ability apart from raw average.

Results are shown to three decimal places with the leading zero dropped, exactly as they appear on a scoreboard or baseball card (for example .300 rather than 0.300). All arithmetic happens locally in your browser, so nothing you enter is uploaded. The tool guards against impossible lines — hits greater than at-bats, or extra-base hits exceeding total hits — so you always get a sensible number rather than a broken one.

Frequently asked questions

How is on-base percentage calculated?
OBP = (H + BB + HBP) / (AB + BB + HBP + SF). Unlike batting average it credits walks and hit-by-pitch and counts sacrifice flies in the denominator, so it captures how often a hitter avoids making an out.
What is OPS and why is it used?
OPS = OBP + SLG, adding on-base ability to slugging power in one number. It correlates well with run production and is popular because it is easy to compute yet far more telling than batting average alone.
Why are averages shown without a leading zero?
Baseball convention writes rate stats between 0 and 1 as .300 or .425 rather than 0.300. The calculator follows this, rounding to three decimals, which is how these numbers appear on scoreboards, cards and stat lines.
What is ISO (isolated power)?
ISO = SLG − BA measures a hitter's raw power by removing singles from slugging. A player batting .300 with a .500 slugging has a .200 ISO, indicating lots of extra-base hits; a slap hitter's ISO is much lower.

More tools