AT THEIR CORE, data tell stories. They reveal patterns, show changes over time, and confirm or challenge our theories. And in cities across the country, mayors, police chiefs, and other local leaders are turning to data to help them understand and address gun violence, one of the most persistent crises they face.

Innovative, data-driven programs are showing encouraging results. To keep high school students on the right track, the city of Chicago scaled up a school-based program called Becoming a Man for seventh through tenth graders living in neighborhoods with high rates of violence. The students reflect on their life goals, learn observe how their automatic responses inside school and outside school differ, and learn to slow down and react more thoughtfully to these sometimes divergent social environments. An adaptive behavior on the street, like fighting back to develop a reputation of toughness that could deter future victimization, will be maladaptive in other social situations. To test the impact of the program, the University of Chicago Crime Lab built a rigorous evaluation into its rollout. After two years, they were able to show that participants were 50 percent less likely to be arrested for a violent crime than students in a control group, and those students graduated at a rate 19 percent higher than those who did not participate. This close analysis of the program affords new insight into what makes the program work, and how to enhance it and apply it in other settings.

While the Becoming a Man study required significant coordination and planning, sometimes measures as simple as counting can produce remarkable findings. Law enforcement officials have long noted that substantially more illegal guns are recovered from Chicago streets than other large US cities—almost as many as in New York City and Los Angeles combined. And when the Chicago mayor’s office analyzed the sources of those recovered firearms, with help from the University of Chicago Crime Lab, it found that many had been first sold by just a small number of gun dealers in the suburbs of the city. One gun dealer in Lyons, Illinois, alone accounted for 659 guns recovered between 2009 and 2013.

When this data came to the attention of the mayor of Lyons, he decided to do something about it. Working with the gun dealer and local law enforcement, he developed a local ordinance for responsible gun sales that requires local shops to comply with several safety measures, including background checks for employees and regular inspections, similar to the Responsible Firearm Retailer Partnership that Mayors Against Illegal Guns (a project of Everytown) developed with Wal-Mart. These types of measures could serve as models far beyond the borders of Lyons.

Other communities offer their own examples of how data can provide insights to improve public safety. In Lafayette Parish, Louisiana, an analysis of crime data last year showed that car burglaries were a leading source of reported gun thefts in the city—a trend that cities have been noticing nationwide. To better keep guns out of dangerous hands, a local criminal justice agency responded by designing a public information campaign that encourages car owners to lock their cars to protect guns and other valuables from theft, and it’s drawn the attention of both law enforcement and the public to this often-ignored source of guns used in crimes.

In Milwaukee, Wisconsin, city and law enforcement leaders have convened regularly for more than a decade as part of the Milwaukee Homicide Review Commission, which studies each of the city’s shootings and sifts them for patterns that can be turned into prevention strategies. In 2006, the commission noted that 10 of the city’s killings in the first six months of the year—about one-tenth of all murders in the city at the time—had followed a dispute at one of the city’s bars. Acting on this information, the city passed a new rule requiring bars to install security cameras after three crime-related police service calls, and homicides at or near bars dropped significantly in the years that followed.

Programs like these will not end gun violence on their own. Cities face an uphill battle while a loophole in our federal gun laws continues to enable criminals to easily buy guns from unlicensed sellers—including strangers they meet at gun shows and online—without a background check. But even with this challenging backdrop, communities large and small are making strides that are saving lives, and they must continue to do so. In September, people involved in each of the examples above participated in the Data for Good Exchange, a conference that brings together innovators from cities across the country to discuss the novel uses of data driving a number of public interest programs.

As officials in Chicago, Lyons, Milwaukee and Lafayette Parish know, we must refuse to accept our urban gun violence crisis as unsolvable. The data show us that it isn’t.