In baseball, an earned run is any run that was fully enabled by the offensive team's production in the face of competent play from the defensive team. Conversely, an unearned run is a run that would not have been scored without the aid of an error or a passed ball committed by the defense.
An unearned run counts just as much as any other run for the purpose of determining the score of the game. However, it is "unearned" in that it was, in a sense, "given away" by the defensive team.
Both total runs and earned runs are tabulated as part of a pitcher's statistics. However, earned runs are specially denoted because of their use in calculating a pitcher's earned run average (ERA), the number of earned runs allowed by the pitcher per nine innings pitched (i.e., averaged over a regulation game). Thus, in effect, the pitcher is held personally accountable for earned runs, while the responsibility for unearned runs is shared with the rest of the team.
To determine whether a run is earned, the official scorer must reconstruct the inning as it would have occurred without errors or passed balls.
If no errors and no passed balls occur during the inning, all runs scored are automatically earned (assigned responsible to the pitcher). Also, in some cases, an error can be rendered harmless as the inning progresses. For example, a runner on first base advances to second on a passed ball and the next batter walks. Since the runner would now have been at second anyway, the passed ball no longer has any effect on the earned/unearned calculation. On the other hand, a batter/runner may make his entire circuit around the bases without the aid of an error, yet the run would be counted as unearned if an error prevented the third out from being made before he crossed the plate to score.
An error made by the pitcher in fielding at his position is counted the same as an error by any other player.
A run is counted as unearned when:
While the inning is still being played, the second and last scenario can cause a temporary situation where a run has already scored, but its earned/unearned status is not yet certain. Under the last circumstance, for example, with two outs, a runner on third base scores on a passed ball. For the time being, the run is unearned since the runner should still be at third. If the batter strikes out to end the inning, it will stay that way. If the batter gets a base hit, which would have scored the runner anyway, the run now becomes earned.
Under the second circumstance, if there are runners on base and a batter hits a foul fly ball that is dropped, and then bats in the runners on base through a base hit (including a home run), the runs are unearned for the time being, as the runners should not have advanced. If the results of the remaining at bats in the inning would not have scored the runners, the runs remain unearned. However, if results of subsequent at bats would have scored the runs anyway, the runs would count as earned, unless they only would have scored as a result of a subsequent error or passed ball.
A baserunner who reaches on catcher's interference and subsequently scores with two outs scores an unearned run, but baserunners who subsequently score after the runner who has reached on catcher's interference exclusively on clean plays score earned runs; the baserunner cannot be assumed to have been put out except for the error. (2019 MLB Rule 9.16(a)(4)).
Neither the use of a pinch-runner to replace a baserunner who represents an unearned run nor the use of a pinch-hitter to continue the turn at bat of a batter who would be out except for an error transforms a run scored by such a person or his successors on base from an unearned run to an earned run.
When pitchers are changed in the middle of an inning, and one or more errors have already occurred, it is possible to have a run charged as earned against a specific pitcher, but unearned to the team. The simplest example is when the defensive team records two outs and makes an error on a play that would have been the third out. A new pitcher comes into the game, and the next batter hits a home run. The runner who reached on the error comes around to score, and his run is unearned to both the prior pitcher and the team. However, the run scored by the batter is counted as earned against the relief pitcher, but unearned to the team (since there should have already been three outs). Had the team not switched pitchers, neither run would be counted as an earned run because that pitcher should have already been out of that inning.
A pitcher who is relieved mid-inning may be charged with earned runs equal to the number of batters who reached base while he was pitching, even if the specific batters he faced do not score. The batters he put on base may be erased by fielder's choice plays after he has been relieved by another pitcher, but if earned runs are scored in the inning the original pitcher is liable for as many earned runs as the number of batters he put on base. Example:
When a pitching change occurs, the new pitcher is said to "inherit" any runners that are on base at the time, and if they later score, those runs are charged (earned or unearned) to the prior pitcher. Most box scores now list inherited runners, and the number that scored, as a statistic for the relief pitcher.