New York City is an expensive place to live for just about everyone, including prisoners.

The city paid $167,731 to feed, house and guard each inmate last year, according to a study the Independent Budget Office released this week.

“It is troubling in both human terms and financial terms,” Doug Turetsky, the chief of staff for the budget office, said on Friday. With 12,287 inmates shuffling through city jails last year, he said, “it is a significant cost to the city.”

Mr. Turetsky added that he was not aware of any previous studies that broke down the cost per inmate in the jails, but there have been national studies.

And by nearly any measure, New York City spends more than every other state or city.

The Vera Institute of Justice released a study in 2012 that found the aggregate cost of prisons in 2010 in the 40 states that participated was $39 billion.