We study how a regulator can best target inspections. Our case study is a US Occupational Safety and Health Administration (OSHA) program that randomly allocated some inspections. On average, each inspection led to 2.4 (9 percent) fewer serious injuries over the next 5 years. Using new machine learning methods, we find that OSHA could have averted as much as twice as many injuries by targeting inspections to workplaces with the highest expected averted injuries and nearly as many by targeting the highest expected level of injuries. Either approach would have generated up to $850 million in social value over the decade we examine. (JEL C63, J28, J81, K32, L51)