Studying crowd dynamics could inform strategies that help to prevent dense gatherings from becoming dangerous.