We develop new quasi-experimental tools to measure racial discrimination, due to either racial bias or statistical discrimination, in the context of bail decisions. We show that the omitted variables bias in observational release rate comparisons can be purged by using the quasi-random assignment of judges to estimate average race-speciﬁc misconduct risk. We find that approximately two-thirds of the aver-age release rate disparity between white and Black defendants in New York City is due to racial discrimination. We then develop a hierarchical marginal treatment effects model to study the drivers of discrimination, finding evidence of both racial bias and statistical discrimination. Outcome-based tests of racial bias therefore omit an important source of racial discrimination in bail decisions, and cannot be used to rule out all possible violations of U.S. anti-discrimination law.