In just one year in Scotland, almost £700 million is spent on bringing adults accused of crime to justice.
This sum includes cost to prosecutors, the Scottish Court Service and the Scottish Legal Aid Board, should financial support to raise a defence be required.
It also covers the cost of imprisonment and community-based punishments should the accused be found guilty.
A breakdown shows that, for the most serious offences, prosecutors will spend an average of £50,500 to bring the case to trial at the High Court.
A further £18,500 will be spent on court costs to cover juror expenses, staff and accommodation for those who take part in proceedings should the accused plead not guilty and the case goes to trial.
If the accused in such a case goes on to claim Legal Aid, an average of £26,400 will be spent on mounting a defence on their behalf, based on figures published earlier this year by the Scottish Government. By the time the case has worked its way through the court system and a verdict is reached, it will have cost an average of £95,372, including the average cost of imprisoning an adult for a year of £37,000.
Someone sentenced to serve 15 years in prison following a trial in the High Court will cost around £640,000 from the time they make their first appearance in the dock to the day they are released.
Guidelines for murder sentencing also include 25 years (£925,000 in prison costs) and 30 years inside for the gravest crimes, which would cost the Scottish Prison Service £1.1 million.
Scots serial killer Peter Tobin and wife murderer Malcolm Webster have both been sentenced to serve a minimum of 30 years in jail.
These figures, of course, relate to the most serious offenders and the gravest of crimes with further analysis also showing the sums spent on those convicted of lesser offences.
Latest figures from the Scottish Government from 2013-14 show that the average custodial sentence in Scotland is around nine-and-a-half months – which will cost the SPS around £29,300. Since 2011, there has been a presumption against prison sentences of three months or less.
A consultation is now under way on whether this should be increased amid strong evidence that short prison sentences are ineffective at preventing reoffending.
Figures show that £37.4m was spent on almost 19,600 community payback orders, community service orders, probation orders and supervised attendance orders in 2013-14. More than £12.8m was spent on criminal justice social reports, requested by sheriffs and judges ahead of sentencing.
A community-based alternative to custody may include a Drug Testing and Treatment Order, issued if a sheriff or judge rules that tackling the drug abuse of a criminal would be more successful in reducing offending behaviour than a custodial sentence.
In Scotland, £5.8m was spent on executing the orders, which are managed by social workers, Each order costs around £9,600, with 614 in 2013-14.
A less serious offender may also be subjected to electronic monitoring rather than custody. Almost 4,000 new offenders were monitored at home in 2013-14 at a cost of £2.8m – or around £730 each.
Earlier this month, Finance Secretary John Swinney announced a £61m cut in the overall Scottish Prison Service budget.
This is partly due to the scrapping of the new women’s prison planned for Inverclyde although day-to-day operational budgets will fall by £9m. Meanwhile, a further £4m will be put into community justice services.
A Scottish Government spokeswoman said: “Scotland’s criminal justice system is developing a stronger emphasis on robust community sentences which focus on actively addressing the underlying causes of offending behaviour such as drugs, alcohol and mental health issues. We are continuing our decisive shift away from ineffective short-term prison sentences by providing an additional £4m investment in the draft budget for 2016-17 towards robust community-based alternatives.”