Black defendants are assigned systematically greater bail levels than whites accused of similar offenses and, partly as a result, have systematically lower probabilities of pre-trial release. We construct a simple model of optimal bail setting that allows us to measure how much of the bail difference is due to judicial bias against blacks, holding constant defendant heterogeneity that judges observe, regardless of whether we also observe it. We show how to use nonparametric methods to consistently estimate the model's key parameter by using the judge's first-order condition to form an auxiliary projection relationship involving defendants' conditional choice probabilities. While the behavioral model requires parametric assumptions, they have a substantial payoff: under these assumptions, we need not make any assumptions at all on the conditional distribution of heterogeneity observed by judges but not researchers. We implement the model using 2000 and 2002 data for five counties, from the State Courts Processing Statistics. While our point estimates are somewhat imprecise, they suggest that in several counties, judges value blacks' lost freedom from a typical pre-trial jail stay by thousands of dollars less than they value whites' lost freedom.