Earned run average calculator
Three earned runs in nine innings is a 3.00 ERA, and one in eight is 1.13: earned runs times nine, divided by innings pitched, with 6.1 and 6.2 read as thirds of an inning, as box scores mean them. Free in your browser.
- Free
- Runs in your browser
- No sign-up
- Your data stays on your device
Run — free
Worked example
- Earned runs
- 3
- Innings pitched
- 9
- Innings actual
- 9
- Earned run average
- 3
- Earned run average text
- 3.00
A baseball earned run average, or ERA, is how many earned runs a pitcher allows per nine innings — the length of a regulation game. Box scores, leaderboards, and baseball cards print that rate to two decimal places because a raw earned-run total hides how long the pitcher stayed on the mound. Coaches, scorekeepers, fantasy managers, and students need the rate from two counting stats: earned runs and innings pitched. This earned run average calculator multiplies earned runs by nine and divides by innings pitched, matching the published identity ERA = (ER × 9) / IP. Innings recorded with baseball tenths .1 and .2 become one-third and two-thirds of an inning, so a line of 6.1 IP is 6⅓ innings rather than 6.1 decimal innings. An innings total of zero or a negative value is rejected because the average would divide by innings pitched.
What earned run average measures and why nine innings
Earned run average answers a pitching question that a raw earned-run total cannot: how many earned runs does this pitcher allow per nine innings, the length of a regulation baseball game? Official scoring packs that idea into one identity: ERA equals earned runs times nine, divided by innings pitched. The result is not a percentage and it is not a count of unearned runs.
Scoreboards, newspapers, and baseball-reference tables print it to two decimal places, so three earned runs in nine innings appear as 3.00 and a dominant start of one earned run in eight innings appears as 1.13. An earned run is a run that scored without the help of a fielding error or a passed ball, as charged by the official scorer; this calculator does not decide which runs were earned. It applies only the published (ER times 9) over IP identity to the two numbers you already have.
Zero earned runs with a positive innings total is a legal 0.00, not missing data. A pitcher who allowed nine earned runs in a third of an inning posts a legal triple-digit ERA. A season or a career with thousands of innings uses the same identity as a single outing.
What to enter and how partial innings count
Baseball box scores write a tenth digit of 1 or 2 for one out or two outs, so 6.1 means six innings plus one out (6⅓) and 6.2 means six innings plus two outs (6⅔). Other fractions, such as 6.5 or 6.333, are treated as true decimal innings rather than as outs. Values must stay within one million so a simulated season or a full career still fits, while pathological billions are rejected.
Example: three earned runs and nine innings yield 3.00. Prefer bare numbers over formatted strings; percent signs and thousands separators are not parsed as input.
Where an earned run average calculator earns its keep
Youth coaches and high-school scorekeepers need a reproducible ERA so a lineup card, a tournament recap, and a parent spreadsheet never disagree on whether three earned runs in 6.1 innings is 4.26. A publisher ranking for earned run average calculator is targeting people who already have an earned-run count and an innings-pitched total and want the two-decimal rate, not a projection system, not a Statcast spin-rate chart, and not a FIP explainer.
Fantasy managers who sit in a weekly waiver review need the same number the official box printed, so they can compare two starters whose raw earned-run totals look similar but whose innings volume is not. Classroom and coaching-certification courses that teach counting stats need an oracle that rejects zero innings and still returns 0.00 when a pitcher threw a shutout, because those two cases are how students confuse no average yet with an average of zero.
Engineers writing scorebook and recap tests pin known-good pairs—three over nine, three over 6.1 rounded to 4.26, and a zero-inning rejection—so a reporting library cannot silently treat ERA as earned runs over games started. Failed validation does not consume balance.
What you can do with it
Box scores and recap pages
Enter official earned runs and innings pitched to publish a two-decimal ERA that matches the box score, whether the line is a single outing, a series, or a season.
Fantasy and pitching-staff comparisons
Convert two earned-run totals that look similar into ERAs against each pitcher's innings volume so playing-time and bulk-relief differences are visible.
FAQ
How do I calculate baseball earned run average?
ERA equals earned runs times nine, divided by innings pitched, rounded to two decimal places. Example: 3 earned runs in 9 innings is 3.00.
What happens if innings pitched is zero?
Earned run average divides by innings pitched, so a zero or negative denominator is rejected and is not billed.
How are innings like 6.1 and 6.2 treated?
Baseball box scores write .1 and .2 for one out and two outs. This calculator converts those tenths to thirds of an inning, so 6.1 IP is 6⅓ innings and 6.2 IP is 6⅔ innings. Other fractions are treated as true decimal innings.
Why two decimal places instead of a raw ratio?
Baseball writes ERA to two decimals (3.00, 1.74, 4.26), not as earned runs per inning. The calculator rounds the nine-inning rate to two decimals and also returns a two-digit text form so 3.00 does not display as 3.
Does ERA include unearned runs?
No. Only earned runs count: runs that scored without the help of a fielding error or a passed ball, as charged by the official scorer. Leave unearned runs out; the calculator does not decide which runs were earned.
Related tools
For developers — API access
Everything on this page is available programmatically. This section is for teams who want to wire it into their own systems; everyone else can just use the tool above.
API endpoint
Prefer to automate it? One authenticated POST creates the task; the result comes back by webhook or a signed link. The same capability also runs here on the web, by email and from Telegram — and soon from our app too.
Call it from your stack
curl -X POST https://api.kit.forhosting.com/sports/earned-run-average \
-H "Authorization: Bearer $KIT_KEY" \
-H "Content-Type: application/json" \
-d '{"earned_runs":3,"innings_pitched":9}'const res = await fetch("https://api.kit.forhosting.com/sports/earned-run-average", {
method: "POST",
headers: {
"Authorization": `Bearer ${process.env.KIT_KEY}`,
"Content-Type": "application/json"
},
body: JSON.stringify({
"earned_runs": 3,
"innings_pitched": 9
})
});
const { task_id } = await res.json();import os, requests
res = requests.post(
"https://api.kit.forhosting.com/sports/earned-run-average",
headers={"Authorization": f"Bearer {os.environ['KIT_KEY']}"},
json={
"earned_runs": 3,
"innings_pitched": 9
},
)
task_id = res.json()["task_id"]<?php
$res = file_get_contents("https://api.kit.forhosting.com/sports/earned-run-average", false, stream_context_create([
"http" => [
"method" => "POST",
"header" => "Authorization: Bearer " . getenv("KIT_KEY") . "\r\nContent-Type: application/json",
"content" => '{"earned_runs":3,"innings_pitched":9}',
],
]));
$task = json_decode($res, true);body := bytes.NewBufferString(`{"earned_runs":3,"innings_pitched":9}`)
req, _ := http.NewRequest("POST", "https://api.kit.forhosting.com/sports/earned-run-average", body)
req.Header.Set("Authorization", "Bearer "+os.Getenv("KIT_KEY"))
req.Header.Set("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)Example request
{
"earned_runs": 3,
"innings_pitched": 9
}Example response
{
"task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
"type": "sports.earned_run_average",
"status": "queued",
"_links": {
"result": "/tasks/tsk_…/result"
}
}The API is asynchronous: the call returns a task_id immediately and the result arrives by webhook. Polling is capped at 1 req/s per task.
Pricing
Published price — no tokens, no invented credits. A failed task is never charged.
Limits
max_abs | 1000000 |
Errors
| HTTP | Code | Meaning |
|---|---|---|
401 | unauthorized | Missing or invalid API key. |
402 | insufficient_balance | Your balance doesn't cover the task price. |
404 | unknown_type | That task type doesn't exist. |
429 | rate_limited | Too many requests. Use the webhook instead of polling. |
Technical notes
Successful calls are billed at $0.002; invalid input is not charged.
What earned run average measures and why nine innings
This endpoint does not compute WHIP, FIP, or unearned runs, does not park-adjust, and does not annualize a small sample.
Input contract, baseball thirds, and response shape
POST a JSON body with two required fields. earned_runs is the official earned-run count over the window you care about and must be a non-negative integer; aliases ER, er, earned_run, and earned are accepted so a scorebook export does not need a rename step. innings_pitched is the innings total over the same window and must be a strictly positive finite number, because ERA divides by innings pitched; aliases IP, ip, and innings are accepted. Each field may arrive as a JSON number or as a numeric string. Missing fields, empty strings, non-numeric values, a non-integer earned-run count, an innings total of zero or a negative innings total, or a value outside those limits fail with invalid_input naming the field and are not billed. On success the body echoes earned_runs and innings_pitched, returns innings_actual as the converted inning count used in the division, earned_run_average as the quotient rounded to two decimal places, earned_run_average_text as that same value always written with two digits after the decimal so 3.00 does not collapse to 3 in a display, and a formula string you can print next to the numbers. Pricing for a successful item is a flat $0.002.
Where an earned run average calculator earns its keep
Keep requests small, pin the two-decimal earned_run_average_text in tests, and you get stable baseball arithmetic for widgets, recap pages, and edge workers without standing up a full stats service of your own.
Integration use cases
Coaching classes and scorebook tests
Students and QA pin three earned runs in nine innings as 3.00, 6.1 IP as 6⅓ innings, and zero innings as invalid_input, matching the textbook identity exactly.
Technical questions
What does the earned run average calculator cost?
The browser tool is free. API requests use prepaid KIT balance at $0.002 per successful call; invalid input is not billed.