Summary. We provide a characterization of participants behavior in a contest or tournament where the marginal productivity of effort varies across contestants and individual productivity is private information. We then consider the optimal design of such a contest. We first analyze contestant behavior for the usual type of contest, where the highest output wins. Abilities need not be independently distributed. We demonstrate that there is a unique symmetric equilibrium output function, that output is increasing in ability, and that marginal effort is increasing in ability, while effort decreases when the cost of effort increases. Next we consider the case where the highest output need not win, with independently distributed abilities. We analyze the contest designers decisions in choosing contest rules optimal from her perspective. We show that the output produced, probability of winning, and contest designers expected revenue are generally increasing in contestants ability. We examine the relationship between the marginal cost of producing output and marginal utility per dollar of the net award for winning.