Nathan Whitfield is frank about how he ended up behind bars, aged just 18.

"I realised the choices I made had led me there, but there were a lot of boys inside who had no family to rely on and no chance of any other existence," he says.

"Being in prison made me realise what I had and how selfish it was to be getting in trouble when there were people there who hadn't had any opportunities."

Whitfield was just 16 when, having fallen in with the wrong crowd, he got involved in a fight in which someone was seriously injured.

After a tortuous two-year court process, he was sentenced to six months in prison for violent disorder, which he spent in Feltham and later Leicester's Glen Parva young offender institutions.

Now 24, he has graduated from drama school and is preparing to appear in a new production of Hamlet, set within the fictional wards of HMP Liverpool.

He plays Guildenstern in what will be the penultimate theatrical production at Hammersmith's Riverside Studios before it closes for two years for a major regeneration.

Hamlet's comment about feeling like a prisoner within Denmark is taken literally in the adaptation, in which he is banged up after being framed for money laundering. From the inside, he sets about avenging the death of his father - not a king this time but the head of a powerful crime syndicate.

Whitfield, who works for a guerilla marketing firm to supplement his acting income, said fellow cast members had been keen to draw on his experience of prison life.

"However much research you do it's never the same as having first hand experience of the atmosphere and feel of life inside. The others would run ideas by me to see what's real and what's not," he said.

"Time seems to slow down inside and after a month or so you stop thinking about what everyone's doing outside. You close your mind down to within those prison walls.

"I think in general at drama schools there's a similar bracket of society. You get a lot of upper middle class people, which is fine, but there's a lot of life they've not experienced."

In Hamlet, Rosencrantz and Guildenstern are courtiers sent by the king to gain the prince's confidence and spy on him.

In this adaptation, they are the mercenaries of the crime syndicate, who are sent in to do all the dirty work, leading to resentment about Hamlet's more privileged lifestyle.

"In other versions of Hamlet, I've always seen them played as quite a studious double act, but here they're very different characters, and I feel my Guildenstern is less of a tool than he's usually portrayed.

"He's not based on any specific character I met in prison but he'd got that quite primal and animalistic mentality of quite a few people you encounter inside; people who are very perceptive to what's going on around them and would sooner cut your face than look at it."

Whitfield saw his fair share of violence during his brief incarceration but despite recent reports about the high assault rate at Feltham YOI he says he was able to keep his head down there.

The trouble only really started when he transferred to Glen Parva.

"Your late teens are a time in a young man's life when there's a lot of bravado, testosterone and aggression," he said.

"At Feltham there was a lot of gang conflict but I wasn't in a gang so it was easy to keep my head down and not get involved. Despite what you read about it, I thought it was a good quality prison.

"Glen Parva was a different story. As soon as I arrived at the induction wing it was horrific.

"People wanted to fight you for the sake of it. All you had to do was look at someone the wrong way.

"A lot of the altercations would happen over pool games, with people fighting over whose turn it was to play next.

"On my first day I said I'm next on the table and another kid said 'no, you're not'. It felt like a test. You can be a pushover or make the decision to stand up and be counted.

"I decided on the latter and when I went up to my cell all the dudes who were friendly with the other guy were there. The next morning they said 'we will f*** you up'.

"Nothing happened for two days but on the third day I was walking to my cell with my breakfast tray when three guys jumped me on the staircase.

"I got a few bruises but the next day the same guys I had the fight with shook my hand and that was that. It was almost like a trial by fire.

"There were fights every day, some of which were quite horrific, and there were people in there I felt should have been in a hospital because they had serious mental health issues."

* Hamlet, by Hiraeth Artistic Productions, is at the Riverside Studios, in Crisp Road, Hammersmith, from May 28 to June 22. For tickets, visit www.riversidestudios.co.uk or call the box office on 020 8237 1111.