Diversification is a widely proposed policing reform, but its impact is difficult to assess. We used records of millions of daily patrol assignments, determined through fixed rules and preassigned rotations that mitigate self-selection, to compare the average behavior of officers of different demographic profiles working in comparable conditions. Relative to white officers, Black and Hispanic officers make far fewer stops and arrests, and they use force less often, especially against Black civilians. These effects are largest in majority-Black areas of Chicago and stem from reduced focus on enforcing low-level offenses, with greatest impact on Black civilians. Female officers also use less force than males, a result that holds within all racial groups. These results suggest that diversity reforms can improve police treatment of minority communities.