The dealers, Aqib Hussain, Mohammed Miah, Izrar Hussain and Omar Faroq were caught after a police operation that involved raids on properties in Walsall.
They dealt in a network which had brought a lot of desolation to the streets in the region.
The four confessed conspiracy to supply drugs at Wolverhampton Crown Court.
Aqib Hussain and Miah were arrested at an address in Ampleforth Drive, Willenhall, on October 22 2015.
Hussain had heroin worth £1,400 in cling film wraps, however drugs that had a value of more than £30,000, along with £5,000 in cash, were recuperated from the property.
An investigation displayed Hussain and Miah were visiting their storage ‘safe house’ regularly to load up on drugs to deal.
Police said Faroq took out a lease for the flat in his name and an additional address in Fellows Park Garden, Pleck.
Officers recovered cocaine and heroin worth £62,000 previously, along with £12,000 in cash from the Pleck property in January 2014, which led to a five-year jail term for a different man.
A search of Faroq’s home in Foster Street found more than £200,000 of heroin in the rear garage.
Izrar Hussain was arrested after evidence was found that linked him to the 2014 offence, which included his fingerprints on items that were recovered in Fellows Park Gardens. After a thorough analysis of all four men’s mobile phones proved their association.
They all pleaded guilty at Wolverhampton Crown Court to conspiracy to supply Class A drugs and were put behind bars for more than 20 years.
Aqib Hussain, aged 23, of Southbourne Avenue in Walsall, was jailed for three years and seven months and 25-year-old Miah, of Wednesbury Road in Caldmore, was handed a five year and two months sentence.
Izrar Hussain, 32, of West Avenue in Handsworth , was put behind bars for two years and Faroq, 28, was locked up for nine-and-a-half years.
Detective Constable Tom Frenchum, from the Force Priorities Team, said: “Drugs cause untold misery and wreck lives. Diligent work by Walsall Police’s neighbourhood and offender management teams, together with Force CID, enabled us to rumble this operation.
“There is no place for cocaine and heroin on their streets and these sentences should act as a stern warning; if you deal in drugs you will be caught and face time behind bars.”