The Guardian worked with 11 specialist law firms and NGOs that deal with deportation detainees to build up a picture of the kind of people being locked up.

Our partner organisations provided anonymised data about a series of key metrics, including age, length of residence and family ties in the UK, length of detention and specific vulnerabilities.

We asked them to enter data about their entire client list on a single day, 31 August.

The partner groups were: Bail for Immigration Detainees, Detention Action, Duncan Lewis Solicitors, Fadiga & Co solicitors, Halliday Reeves solicitors, Medical Justice, Parker Rhodes Hickmott Solicitors, Turpin & Miller solicitors, Wilson Solicitors, Women for Refugee Women and Yarl’s Wood Befrienders.

The NGOs have responded to our findings and have put forward plans for a detention wishlist. All want to see detention ended or dramatically scaled back. Until that happens they are calling for sweeping and immediate changes.

Quick Guide Britain's immigration detention system Show How many people does Britain lock up, pending deportation? More than 27,000 people were detained in 2017, according to the most recent figures. At any one time, there may be up to 3,000 people in detention. In 1993 there were 250 detention places. By 2005 there were 2,644 places. Where are they held? Detainees are held in eight detention centres and two ‘short term holding facilities’. Eight are in England, one in Scotland and one in Northern Ireland. Some can be held for months, even years. A Guardian survey of 200 detainees found average term length is about four months. Who are they? The nationality of detainees change over time. The Guardian survey found Nigeria and Algeria were most commonly represented among our responses, while Home Office open data for the second quarter of 2018 showed that South Asian countries made up the largest proportion of detainees. TDetainees are overwhelmingly male - women made up just 15% of the total detention population in 2017.

Celia Clarke, the director of Bail for Immigration Detainees, said: “While the detention system still exists we would want there to be judicial oversight of the decision to detain and to maintain detention, as there is in the criminal justice system when individuals are facing the possibility of loss of liberty by being remanded in custody.

“It is clear that, with 84% of those surveyed not having removal directions, that detention is used for administrative convenience and not for the purpose for which it was established. Such unnecessary cruelty has to end.”

Bella Sankey, the director of Detention Action, said: “The Guardian data reveals the futility and wastefulness of Theresa May’s detention system. Long-term residents, parents, traumatised torture survivors, the unwell, infirm and suicidal are all turned into forever prisoners, with no hope of release for months and years on end.

Our doctors assess detainees who have been emotionally destroyed Emma Ginn, director of Medical Justice

“Indefinite detention is unfair, irrational and wrong and in the land of Magna Carta we urge our parliament to heed these findings and commit to a strict statutory time limit.”

Natasha Walter, the director of Women for Refugee Women, said: “Despite all the campaigning that has happened over the last few years, which has pushed the government to promise reform, it is clear from these findings that the current system of detention remains inhumane and unjust as well as inefficient.

Women for Refugee Women works closely with many women who have survived torture, rape and other gender-based violence only to find themselves locked up in the UK. The Guardian’s survey bears out our finding in our most recent report that vulnerable adults are still being routinely detained under the new ‘adults at risk’ policy.

“We note that the vast majority of those whose cases are covered in this survey did not have removal directions. The Home Office’s own statistics show that overall more than 80% of women who have sought asylum and are detained are indeed released back into the community, which illustrates the utter pointlessness as well as inhumanity of the current system.”

Emma Ginn, the director of Medical Justice, said: “It is now widely accepted that immigration detention exacerbates existing medical conditions and can cause mental illness. Our volunteer doctors see a disturbingly high level of medical mistreatment of detainees.

“This is evident in cases where the courts found ‘inhuman and degrading treatment’ and in the rising rate of deaths, which are all preventable as immigration detention is optional. Our doctors assess detainees who have physically declined in detention, psychologically deteriorated and have been emotionally destroyed.”

Racist detention policies have been cynically deployed Toufique Hossain, director of public law at Duncan Lewis Solicitors

James Elliot, the head of Wilson Solicitors’ public law department, said: “As this survey sadly confirms, the Home Office continues to detain vulnerable people where there is no prospect of their removal. Not only does this cause serious harm to those detainees but is an expensive waste of taxpayers’ money.”

Toufique Hossain, the director of public law at Duncan Lewis Solicitors, said: “There is meant to be a presumption to liberty; it is at the cornerstone of our society. It has been left to brave detainees, facing overwhelming tides of legal aid cuts, to challenge the arbitrary and indefinite detention in disgraceful conditions.

“Time and again they are vindicated by the courts. None of this has troubled successive home secretaries. That is because racist detention policies have been cynically deployed to ensure administrative convenience on the way to expedient political success.”

Wishlist for Immigration Removal Centre policy