In baseball, an earned run is any run for which the pitcher is held accountable (i.e., the run scored as a result of normal pitching, and not due to a fielding error or a passed ball). Any runner who tags his base and reaches home plate is scored against the pitcher as an earned run. An error made by the pitcher in fielding at his position is counted the same as an error by any other player.
Earned runs are specially denoted because of their use in calculating a pitcher's earned run average – the number of earned runs allowed per 9 innings (regulation game) pitched. Earned runs stem from the theory that the pitcher has sole responsibility to earn strikes against an opposing batter until at least three batters are retired in each inning of play, and nine innings (a complete game) are pitched.
To determine whether a run is earned, the official scorer must reconstruct the inning as it would have occurred without the errors (for purposes of this rule, the "errors" also include passed balls). The benefit of the doubt is always given to the pitcher in determining which bases would have been reached by errorless play.
If no errors and no passed balls occur during the inning, all runs scored are automatically earned (assigned responsible to the pitcher). In a few 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 impact on the earned/unearned calculation.
Unearned run 
A run is counted as unearned when:
- A batter reaches base on an error (including catcher's interference) that would have retired the batter except for the error, and later scores a run in that inning by any means.
- A batter hits a foul fly ball (when the infield fly rule is not in play) that is dropped by a fielder for an error, extending the at bat, and later scores a run in that inning by any means. In this case, the manner in which the batter reached base becomes irrelevant.
- A baserunner remains on base as the result of an error on a fielder's choice play that would put the baserunner out except for the error, and subsequently scores a run in that inning by any means.
- A batter reaches first base on a passed ball (but not a wild pitch) and subsequently scores by any means.
- A baserunner scores by any means after the third out would have been made except for an error other than catcher's interference.
- A batter reaches base on a fielder's choice which removes a baserunner who has reached base safely on an error or has remained on base as the result of an error, reaching first base on a passed ball on a called or swinging third strike, or remained on base on an error on a fielders' choice play that should have retired him, and subsequently scores.
- A batter or runner advances one or more bases on an error or passed ball and scores on a play that would otherwise not have provided the opportunity to score.
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 (but not on first 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 next batters either strike out or hit an infield fly that would not have advanced the runners, the runs remain unearned. However, if subsequent batters reach on clean plays which would have scored the runs anyway, the runs would count as earned, except for the runner that reached base through an at-bat extended by the dropped foul fly ball error.
A runner 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. (Rule 10.16(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 is only charged with the number of runners that reached base while he was pitching, and this does not include baserunners who reach base as the result of a fielder's choice play that removes an existing runner; such a runner is charged to the pitcher whose baserunner has been removed by the fielder's choice play. 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.
Historical differences 
In the early history of major league baseball, the difference between the number of earned runs given up by a pitcher and the total number of runs given up was much more significant than today. For instance, Jim Devlin in 1876 pitched 66 complete games (662 innings pitched) with a 1.56 ERA but managed to record only five shutouts. The seeming discrepancy comes from the difference in the number of allowed runs (309) versus earned runs (108).
See also