In baseball statistics, an error is the act, in the judgment of the official scorer, of a fielder misplaying a ball in a manner that allows a batter or baserunner to reach one or more additional bases, when such an advance would have been prevented given ordinary effort by the fielder.
An error does not count as a hit but still counts as an at bat for the batter unless, in the scorer's judgment, the batter would have reached first base safely but one or more of the additional base(s) reached was the result of the fielder's mistake. In that case, the play will be scored both as a hit (for the number of bases the fielders should have limited the batter to) and an error. However, if a batter is judged to have reached base solely because of a fielder's mistake, it is scored as a "hit on error," and treated the same as if a batter was put out, which would lower his batting average.
Similarly, a batter does not receive credit for an RBI when runs score on an error, unless the scorer rules that a run would have scored even if the fielder had not made a mistake. For example, if a batter hits a ball to the outfield for what should be a sacrifice fly and the outfielder drops the ball for an error, the batter will still receive credit for the sacrifice fly and the run batted in.
If a play should have resulted in a fielder's choice with a runner being put out and the batter reaching base safely but the runner is safe due to an error, the play will be scored as a fielder's choice, with no hit being awarded to the batter and an error charged against the fielder.