For activists calling for defunding city police departments, one of the first challenges will be figuring out how much money city police departments have in the first place.

WGBH News analyzed city budget documents for the 25 largest cities and towns in the state and found that police budgets generally make up between 5 and 10% of the total city budget, including schools. But experts and activists on all sides of the debate said it is impossible to compare police budgets based on those raw numbers alone because cities often assign costs in different ways.

“It's really complicated and very difficult to make apples-to-apples comparisons between communities,” said Jeff Beckwith, executive director of Massachusetts Municipal Association.

“One community might take all of their employee benefits and put them in a separate line item. Others might have them incorporated into the police and schools and public works line items,” Beckwith said. “So ... it's very hard to take a look and say, ‘This is the percent that's being spent on all activities that are related to policing.’”

Police departments — in Massachusetts and other states — also may have money coming from outside the city budget.

For instance, Lowell’s city budget sets aside about $29 million for police. But City Manager Eileen Donoghue said “a significant portion of the Lowell Police Department’s operating budget is comprised of grant funding issued from state and federal sources,” which would not be reflected in the city’s budget numbers. The department has its own research and development office that pursues federal grants outside the city’s budget process.

In some cases, Donoghue said, the department generates funding for other organizations. For instance, she said, the department won a $700,000 “Safe & Successful Youth Initiative” grant from the state’s Executive Office of Health and Human Services. Over $600,000 of that grant was then “sub-granted” to a local non-profit called UTEC “to support community-based strategies to eliminating serious violence among high-risk, urban youth ages 14-24,” she said.

With federal grants and other funding streams for police, “it is very difficult to get a sense of how much money there is all together” going to the police, said Kade Crockford of the ACLU of Massachusetts. And in many places, “there doesn’t appear to be any organized tracking” of outside funds.

Crockford said in many cases, it is not clear city leaders know where all the money is coming from. “In the past, city councils have generally not paid much attention to these grants” that police departments are getting from state and federal sources.

In some cases, police budgets are also intertwined with other agencies. For instance, in Worcester, “the police and the schools have this very intimate connection, problematically intimate,” said Kaitlyn Selman, assistant professor of criminology at Framingham State University and an organizer in Defund WPD, the movement to defund the Worcester police.

Budget documents show that Worcester public schools reimbursed the police department $120,000 for “school resource officers” last year, as well as paying police for security during games and other events.

Selman said her focus is “not just about defunding the police. It's also about investing those resources into other institutions.” She points out that Worcester had a $53 million budget for its police department last year, but the city health department only had a budget of about $3 million and the public health unit had less than $1 million.

“We only have so much money, and if you put a lot of your money in policing or prisons, that's less money that you have for things like public health and schools and libraries and public transit and safe and affordable housing,” she said.

Some of the costs of policing are baked into the union contracts that cities are locked into.

For instance, Crockford said the Boston Police contract requires officers to be paid four hours of overtime anytime they have to appear in court, even if they are only there for a few minutes.

But those contracts are hard to fix. “We’re in a six-year ongoing conversation with the patrolman’s union to settle a contract,” said Lawrence Mayor Dan Rivera. “It’s the only contract I haven’t settled as mayor.” Police contracts in Massachusetts automatically renew after a three-year period if they are not replaced with a new contract.

Lawrence’s police budget — around $14 million — consumes a smaller portion of the city’s finances than almost any other city in the state. Rivera said the city has historically had a very small police force despite efforts to recruit more officers.

But Rivera said that some view the “defund the police” conversation as being about retraining police for things like conflict de-escalation and cultural sensitivity. That training winds up being an additional cost, not a savings.

Boston’s police budget, at around $414 million, is the biggest in the state. Mayor Marty Walsh said Wednesday that he remains committed to listening to community concerns about racial inequities in policing, but he warned that “Cutting the budget, just cutting the budget doesn’t solve anything. Cutting the budget doesn’t solve racism, it doesn’t solve systemic issues.”

Ian McInturf and Miriam Hyman, interns with WGBH’s New England Center for Investigative Reporting, contributed to this report.