For anyone, no matter what's led them to being there, prison can be terrifying.
For anyone who's gay, it can be particularly frightening, lonely... and dangerous. Some try to hide their sexuality. Some dare to come out or find themselves "outed". Some have sex. Some even fall in love.
In Gay On The Inside, Stephen Fry, who is a former prisoner himself having spent time inside for credit card fraud at the age of 17, uncovers surprising stories and shares his own recollections of the atmosphere in jail - including his thoughts on how far the country really has come in tacking homophobia.
We hear from Mark, pacing up and down the landing outside his cell in HMP Brixton. Mark couldn't abide his cell mate, told him to pack his stuff and get out. Why? Because his cell mate was gay.
It's not always easy to be yourself on the wings of a prison like Brixton or HMP Parc near Cardiff, according to serving inmate Daniel. On the outside he'd always been openly gay but, as he reveals in the programme, life in prison is different.
In stark contrast, Hayley in HMP Styal says being gay in a women's prison is like being in a candy shop. It's also a complicated place where being straight on the outside doesn't stop you having a girlfriend on the inside. Suzie, Nicky and Ashleigh have strong views and reveal them in the documentary.
We also hear from Paul, who made the bravest of moves, to 'come out' on the wings. He has since been released and was surprised at how accepting his fellow prisoners were of his decision.