Baseball Stats Calculator

Batting average, on-base percentage, and ERA from a stat line, with 9, 7, or 6 inning games for baseball, softball, and little league. Everything runs in your browser. Nothing is uploaded.

Batting
Type a batter's line and both averages update as you go. Blank fields count as zero.

Enter a batter's line to see the averages.

Pitching
Innings use baseball notation: 6.2 is 6 and 2/3 innings, and the digit after the decimal counts outs, so it stops at 2.

Enter earned runs and innings pitched to see an earned run average.

How to use

  1. Type the batter's line into the batting card: at-bats, hits, walks, hit by pitch, and sacrifice flies. Batting average and on-base percentage update as you type, and blank fields count as zero.
  2. For ERA, type earned runs and innings pitched in baseball notation: 6.2 means 6 and 2/3 innings. Pick the game length, 9 for standard baseball, 7 for softball, or 6 for little league.
  3. Read the results under each card. Averages show three decimals like a scoreboard, and ERA scales your earned runs to a full game of the length you picked.
  4. Fix any line the calculator flags. More hits than at-bats, a tenths digit above 2, and negative counts all report themselves instead of showing a number.

The formulas

Source: the MLB.com glossary definitions of batting average, on-base percentage, and earned run average.

Frequently asked questions

Are my stats uploaded or stored anywhere?

No. Every calculation happens in your browser tab as you type. Nothing is uploaded, nothing is stored, and the page sets no cookies. Ad slots on the page are served by third-party networks, which follow their own privacy policies.

How do I enter innings pitched?

Use baseball notation, where the digit after the decimal counts outs: 6.2 is 6 and 2/3 innings, 6.0 is exactly 6, and 0.1 is a lone out. The digit stops at 2, so a scorecard entry like 6.3 is rejected because a third of an out cannot happen.

Why does ERA ask for the game length?

Earned run average scales earned runs to a full game. Standard baseball plays 9 innings, softball 7, and little league 6, so the calculator divides by the length you pick. The same pitching line scores a lower ERA in a shorter game.

What goes into on-base percentage?

Hits, walks, and hit-by-pitches over at-bats plus walks, hit-by-pitches, and sacrifice flies. Sacrifice bunts stay out entirely. A batter who has only walked, never batted, scores 1.000 because every trip to the plate reached base.

Why does the calculator refuse some stat lines?

More hits than at-bats cannot happen, a tenths digit above 2 means more than three outs in an inning, and negative or fractional counts do not exist on a scorecard. The calculator reports the problem instead of showing a number.