# Baseball Batting Average Calculator

> Calculate a baseball batting average from hits and at-bats, plus on-base percentage, slugging percentage and OPS using the official stat definitions.

Category: Everyday tools · Applies to: Worldwide · Last updated: 2026-10-29
Interactive calculator: https://calculators.geekmidst.com/calculators/baseball-batting-average-calculator

Batting average is hits divided by at-bats, shown to three decimals (.300). Add walks, hit-by-pitches, sacrifice flies and extra-base hits to get OBP, SLG and OPS too.

Also called: AVG calculator, OPS calculator, Softball batting average calculator.

## Inputs
- Hits (H) (default 150)
- At-bats (AB) (default 500)
- Doubles (2B) (default 30; optional)
- Triples (3B) (default 3; optional)
- Home runs (HR) (default 20; optional)
- Walks (BB) (default 60; optional)
- Hit by pitch (HBP) (default 5; optional)
- Sacrifice flies (SF) (default 5; optional)

## Results
- Batting average (AVG)
- On-base percentage (OBP)
- Slugging percentage (SLG)
- OPS (OBP + SLG)
- Total bases

## Formula

```
AVG = H ÷ AB;  OBP = (H + BB + HBP) ÷ (AB + BB + HBP + SF);  SLG = (1B + 2×2B + 3×3B + 4×HR) ÷ AB;  OPS = OBP + SLG
```

Where:
- 1B: singles = H − 2B − 3B − HR
- AB: official at-bats
- BB, HBP, SF: walks, hit-by-pitches and sacrifice flies

## Worked example
1. AVG = 150 ÷ 500 = .300.
2. OBP = (150 + 60 + 5) ÷ (500 + 60 + 5 + 5) = 215 ÷ 570 = .377.
3. Singles = 150 − 30 − 3 − 20 = 97; total bases = 97 + 60 + 9 + 80 = 246; SLG = 246 ÷ 500 = .492.
4. OPS = .3772 + .4920 = .869.

**Result:** A 150-for-500 season with 30 doubles, 3 triples and 20 home runs is a .300/.377/.492 slash line with an .869 OPS.

## What the result means

AVG counts every hit the same and ignores walks. OBP shows how often a batter avoids making an out, and SLG how much damage each hit does, which is why OPS is a better single summary.

## Assumptions and limits
- Definitions follow MLB’s official statistics; reaching on an error or fielder’s choice is not a hit or a time on base.
- Sacrifice bunts are excluded from at-bats and OBP, as in the official definitions.

## Questions

### Why is batting average written without a leading zero?

It is a convention: .300 is read “three hundred” and means 30% of at-bats ended in a hit.

### Do walks count as at-bats?

No. Walks, hit-by-pitches, sacrifice flies and sacrifice bunts are plate appearances but not at-bats, so they do not lower a batting average.

## Sources
- [Batting average (MLB.com glossary)](https://www.mlb.com/glossary/standard-stats/batting-average)
- [Slugging percentage (MLB.com glossary)](https://www.mlb.com/glossary/standard-stats/slugging-percentage)
- [On-base percentage (Baseball-Reference)](https://www.baseball-reference.com/glossary/?p=97)

## Related calculators
- [Basketball Effective Field Goal Percentage Calculator](https://calculators.geekmidst.com/calculators/basketball-effective-field-goal-percentage-calculator)
- [Percentage Calculator](https://calculators.geekmidst.com/calculators/percentage-calculator)
- [Average Calculator](https://calculators.geekmidst.com/calculators/average-calculator)

Source: GM¹X CalcVerse — https://calculators.geekmidst.com/calculators/baseball-batting-average-calculator
