This paper studies heterogeneity in the impact of job displacement using rich administrative data from Sweden. We use generalized random forests to identify, based on worker characteristics, groups of workers who are most vulnerable to displacement and document substantial variation in displacement losses. The hardest-hit decile of workers loses over eight times as much in terms of earnings in the short run as the most resilient decile of workers. While we construct groups based on short-term impact, substantial group differences in outcomes persist at least ten years after displacement. We assess the relative importance of different factors, finding that worker attributes and semi-aggregate local and industry conditions interact to generate predictable variation in post-displacement earnings losses. Age and education level are strong predictors of earnings losses, with older and less-educated workers losing six times as much as younger and highly educated workers. Nevertheless, the losses of the most resilient quartile of old low-educated workers and the least resilient quartile of young highly-educated workers are similar in size. Much of this remaining heterogeneity is related to industry and location-specific characteristics. Working in manufacturing and living in a rural area are strong predictors of severe displacement losses, conditional on individual attributes. Losses are twice as large for workers displaced under bad as compared to good industry and location conditions. Our analysis of how to target interventions towards the most affected workers suggests that no simple rule is as effective at identifying vulnerable workers as the more flexible generalized random forest, but targeting older workers displaced from manufacturing plants achieves the closest result.