The empirical literature on deterrence tends to find stronger and more consistent evidence in support of the deterrent effect of the certainty than for the severity of punishment. Three distinct explanations have been advanced: (1) risk preferences of potential criminals, (2) the present orientation of potential criminals, and (3) stigma. We report an experiment that rules out the second and third explanations by design, and that provides a direct test of the first explanation. We find that risk averse participants are more deterred by severity, as predicted by theory. Yet risk seeking participants are not more deterred by certainty if the offense has a positive expected value, or if its expected value is zero. The theory is only supported if the sanction is so severe and frequent that committing the offense has a negative expected value.