Everyday Utilities

Baseball Stats Calculator (AVG, OBP, ERA)

Get a hitter or pitcher stat line from the counts in a box score.

Your numbers

Stats for a

Result

Batting average

.300

150 hits in 500 at bats

On-base percentage (OBP)
.366
Slugging percentage (SLG)
.492
OPS
.858
Isolated power (SLG - AVG)
.192
Singles
97
Total bases
246
Plate appearances counted
560
How this was calculated
  1. AVG = hits / at bats = 150 / 500 = 0.3.
  2. OBP = (hits + walks + hit by pitch) / (at bats + walks + hit by pitch + sacrifice flies) = (150 + 50 + 5) / (500 + 50 + 5 + 5) = 0.36607.
  3. Total bases = singles + 2 x doubles + 3 x triples + 4 x home runs = 97 + 60 + 9 + 80 = 246. SLG = total bases / at bats = 0.492.
  4. OPS = OBP + SLG = 0.85807. Each rate is shown to three decimals.
  • Sacrifice bunts, catcher interference and intentional walk rules vary by scoring source, so check how your league counts them. At bats do not include walks, hit by pitch or sacrifices. Home runs are already counted inside hits.

Calculated using SumPanda.com · https://sumpanda.com/baseball-stats-calculator/

Results are estimates for general information. Verify important figures before relying on them.

Next step

How to use the baseball stats calculator (avg, obp, era)

  1. Choose Hitter or Pitcher.
  2. For a hitter, enter at bats, hits, doubles, triples, home runs, walks, hit by pitch and sacrifice flies.
  3. For a pitcher, enter innings pitched in baseball notation (180.1 means 180 and one third), earned runs, hits, walks and strikeouts.
  4. Read the rate stats, the formulas and the totals behind them.

Formula

AVG = hits / at bats

OBP = (hits + walks + hit by pitch) / (at bats + walks + hit by pitch + sacrifice flies)

SLG = total bases / at bats, with total bases = singles + 2 x doubles + 3 x triples + 4 x home runs

OPS = OBP + SLG; ISO = SLG - AVG

ERA = 9 x earned runs / innings pitched; WHIP = (walks + hits) / innings pitched

Innings are converted from outs: .1 is one third and .2 is two thirds. Hitting rates are shown to three decimals, with no leading zero below 1.

500 at bats and 180 and a third innings

A hitter with 500 at bats, 150 hits, 30 doubles, 3 triples, 20 home runs, 50 walks, 5 hit by pitch and 5 sacrifice flies has 97 singles and 246 total bases. AVG is .300, OBP is 205 / 560 = .366, SLG is 246 / 500 = .492 and OPS is .858. Isolated power is .192.

A pitcher with 180.1 innings, 65 earned runs, 160 hits, 50 walks and 190 strikeouts has an ERA of 9 x 65 / 180.333 = 3.24 and a WHIP of 210 / 180.333 = 1.16. Strikeouts per nine innings are 9.48, walks per nine 2.50 and strikeouts per walk 3.80.

What each stat tells you

Batting average is how often a hitter gets a hit, and on base percentage adds walks and hit by pitch to show how often he reaches base. Slugging weights extra base hits, and OPS adds the two to give one measure of getting on base and hitting for power.

ERA shows earned runs per nine innings, and WHIP shows base runners allowed per inning. They help compare pitchers across different workloads. For another sport's rating formula, see the passer rating calculator.

Scoring details

At bats do not include walks, hit by pitch or sacrifices, and home runs are already part of hits. Sacrifice bunts are not entered in OBP because the formula leaves them out. Leagues and data sources may count a few rare plays differently, so check yours if numbers need to match a published stat.

To average a column of numbers on your own, the average calculator helps, and the golf score calculator covers a different sport.

Assumptions and limits

  • The sample numbers are an example, not a real player.
  • Hits must include doubles, triples and home runs, and cannot exceed at bats.
  • ERA is scaled to nine innings. A league that scales to seven innings will show a different number.
  • Only earned runs count in ERA, so unearned runs are left out.

Formulas reviewed October 10, 2026. See the calculation methodology for how SumPanda rounds, tests and sources its formulas.

Frequently asked questions

How do I calculate batting average?

Divide hits by at bats. A hitter with 150 hits in 500 at bats has an average of .300.

What is the difference between OBP and batting average?

OBP also counts walks and hit by pitch as reaching base, and it adds sacrifice flies to the denominator. A hitter who walks a lot has an OBP well above his average.

How do I enter innings like 6 and two thirds?

Write 6.2. The digit after the point is the number of outs, so 6.1 is six and one third and 6.2 is six and two thirds.

How is ERA calculated?

Multiply earned runs by 9 and divide by innings pitched. Sixty five earned runs in 180 and one third innings is 3.24.