Changes are in the pipeline for the sentencing of sex offenders. But what principles govern how long a criminal is jailed for?

During the reign of George I a person could be executed for posing as a gypsy. Attempted murder was classed as a "misdemeanour" until 1803 whereas forgery was a hanging offence.

The seriousness with which particular crimes are viewed shifts according to the mores of the day. Who decides on a criminal's fate has also changed.

In the past capital punishment might be down to the whim of kings and queens, Parliament or the discretion of judges. Today there is a body that hands down sentencing guidelines to judges.

The Sentencing Council, which covers England and Wales, has just announced a consultation into how sex crimes are punished.

Too lenient? In July 2012 Judge Gareth Hawkesworth spared a 14-year-old boy from a custodial sentence, after he was found guilty of sexually assaulting a four-year-old girl. He told the defendant: "I believe you have become sexualised by your exposure to and the corruption of pornography... . It was the fault of the world and society." The judge was criticised by the victim's parents who accused him of making "a cheap point"

It is expected to result in longer sentences for rape, and similar offences, to recognise the long-term trauma experienced by the victim.

The issue of sexual offenders filming victims is also being looked at. It is a reminder that sentencing must keep track with the way technology affects criminal behaviour.

Keeping up with changes in society is just one of the challenges facing the 15 men and women who sit on the Sentencing Council. Most are lawyers, all have a connection to criminal justice.

Lord Justice Leveson is there, as is Keir Starmer the Director of Public Prosecutions, and Katharine Rainsford, who writes historical novels under the pen name Katharine McMahon, but is also a magistrate.

"We look to see where there's a pressing need to fill a gap if there isn't a guideline, or to repair some sort of deficiency," says Mr Justice Globe, a high court judge who sits on the panel.

Too severe? After the riots of August 2011 two men received four-year jail sentences for inviting friends on Facebook to start a riot in the Cheshire town of Northwich. The judge told the defendants: "This happened at a time when collective insanity gripped the nation. Your conduct was quite disgraceful." An appeal against the sentence was dismissed.

Sentencing is always contentious. The public can be quick to anger, especially when courts hand out sentences seen as too lenient. When child abductor Craig Sweeney was given an indeterminate sentence with a minimum of five years in 2006 there was an outcry, but the judge had correctly applied the law then in force.

Judges, too, sometimes complain. Last month a judge condemned the "embarrassing inadequacy" of his sentencing powers when jailing a driver who had knocked down a woman after a ram raid on a shop.

Because the man pleaded guilty he could be given only a 16-month sentence for aggravated vehicle-taking.

Sometimes, the guidelines miss out crimes altogether. In October a committee of MPs argued that a lack of sentencing guidelines meant that people deliberately poisoning birds of prey were not being punished.

Image caption Sentencing guidelines aim to promote consistency in judges' decisions

Stop a man or woman in the street and ask how many years a rapist or murderer should get and you may get some strong views. But ask what factors should be taken into account when sentencing criminals and the debate becomes more complex.

There are five broad principles that inform the Sentencing Council's decisions, says Globe:

protecting the public

punishing the offender

deterring crime

rehabilitating the offender

offering reparation to the victim

But how much weight is given to each of these, remains obscure.

Too lenient? In September 2012 Judge Peter Bowers handed a year's suspended sentence to a burglar at Teesside Crown Court, saying, "It takes a huge amount of courage, as far as I can see, for somebody to burgle somebody's house. I wouldn't have the nerve." Judge Bowers has since been reprimanded by the Office for Judicial Complaints - it said that his remarks had "damaged public confidence in the judicial process".

Anyone can read the reams of guidance on the Sentencing Council website. To take one category of offence, assaults involving grievous bodily harm, there are nine steps that must be followed.

The first two are the most important. Step one weighs up how serious the offence is by measuring the harm done and the culpability of the offender.

Greater harm is indicated by "serious" injury to the victim, a sustained or repeated attack and the personal circumstances of the victim. But the definition of serious injury is again fundamentally contentious.

Culpability is governed by another 15 factors, including premeditation, use of a weapon, or having taken on the leading role in a gang.

Too severe? In 2009 a judge at Leicester Crown Court sentenced Sam Stanger to two years in jail, for stealing a traffic warden's camera during a row over a parking fine. A campaign to free Stanger attracted 2,000 supporters, including his local MP. But he was refused the right to appeal, being told by an appeal judge: "The starting point for sentence taken by the judge was within the bracket of appropriate sentences... and is not manifestly excessive."

The 19 factors, in total, put the offence into one of three categories of seriousness.

Step two sets out the range of any jail sentence. Depending on the category of seriousness, a sentence will range from 9-16 years, 5-9 years, or for the least harm and culpability 3-5.

There are a slew of aggravating and mitigating factors. Did the offender have previous convictions? What was the ongoing effect on the victim? Was there "gratuitous degradation"?

But what makes degradation "gratuitous"? The guidelines don't say.

There are plenty more factors. Was the victim forced to leave their home? Was the offender drunk or on drugs?

Was the assault just a single blow? Was the offender previously of good character?

Steps three to nine look at mitigating factors, reduction for guilty pleas and a range of other technical issues.

The 27 pages of assault guidelines on their own have the potential to baffle even a hardy layman.

"I have the greatest sympathy with the public," says Sir Louis Blom-Cooper, a QC and legal academic. "The system for sentencing is immensely complicated even for judges."

Life sentences All murders attract mandatory life sentence; minimum term is set, which offenders must serve before parole is considered

Offences such as armed robbery can be punished with discretionary life sentence

Life offenders are only ever released on licence, and can be recalled to jail if they break licence terms

Most serious offenders punished with "whole life tariff", and will never be released More from the Magazine; The history of life

The prescriptiveness of the guidelines has gone too far, Sir Louis argues. "The judiciary is very, very angry it's got to go through these tortuous exercises. It's a mess," he says.

Until recently, Parliament set maximum and minimum sentences and judges were given discretion to set the duration of a sentence.

Ever since the 1980s there's been simmering tension between the executive and judiciary over sentencing.

It looked like European law had won the battle for the judges, keeping politicians at arms length from judicial matters, Sir Louis recalls.

But the Blair government led by Home Secretary David Blunkett fought back in 2003 with a new Criminal Justice Bill. It gave Parliament the right to set minimum terms for murder and brought in a sentencing guide for judges.

The Lord Chief Justice attacked Blunkett's changes, arguing that judges were being given no room for manoeuvre. Judges should be allowed to "make the just decision, in the light of the particular circumstances of the cases, having heard argument from both sides", he said.

David Blunkett declines to comment today. But at the time he said that citizens expected a "clear framework" of minimum sentences when it came to murder.

Globe believes that the Sentencing Council has made things more transparent. And public perception of sentencing is "terribly important".

Sentencing in Scotland Scottish government says it places great importance to judicial independence and discretion in sentencing

Role of government is to ensure courts have "sufficient range of penalties"

Provision exists under 2010 law to create Scottish Sentencing Council, which will promote awareness, consistency and development of sentencing Sentencing and Criminal Penalties in Scotland

One of the big changes is the focus on the victim, he argues.

"We've done a lot of research with the public, particularly in relation to victims. The harm that has been caused to a victim is extremely important to what a sentence should be."

Sentencing has changed remarkably over recent centuries. In the 18th Century serious criminals were executed or transported to America. After the war of independence a new dumping ground for the criminal classes had to be found and in 1787 the first fleet landed at Botany Bay, Australia.

In those days there was a simple menu of punishments for convicts being transported - seven years, 14 years or life, Sir Louis says.

Today judges must decide about whether "incitement to riot" on social media equates to the more traditional version of the offence.

Globe says that the Sentencing Council must keep up with these phenomena.

But in the end it comes down to the same basic principles - harm and culpability - although how they're calculated still has the potential to bamboozle the layman.

You can follow the Magazine on Twitter and on Facebook