The first people to be liberated by Britain in the second world war were our own criminals. As the declaration of hostilities was announced in 1939, the gates of the country's prisons swung open for any inmate with less than three months left to serve and all the Borstal boys who had completed six months.

Next month sees the 70th anniversary of the start of the blitz and there will be, quite rightly, many celebrations of the courage and stoicism displayed during it. What may receive less publicity are the activities of those who took advantage of the confusion to make their criminal fortunes because, as most of the nation pulled together to help each other, others were very busily helping themselves.

One of the first lucky ones to pick up a get-out-of-jail-free card was Billy Hill, the dapper gangster from Seven Dials central London, who would emerge from the war as the leading figure in the capital's underworld. He immediately appreciated what a fabulous opportunity the war presented. "I don't pretend to be a King and country man, but I must say I did put my name down to serve and until they came to get me I was making the most out of a situation," said Hill in his ghosted autobiography, Boss of Britain's Underworld, published in 1955. "So that big, wide, handsome and, oh, so profitable black market walked into our ever open arms. Some day someone should write a treatise on Britain's wartime black market. It was the most fantastic side of civilian life in wartime. Make no mistake. It cost Britain millions of pounds. I didn't merely make use of the black market. I fed it."

Hill also realised that the departure of so many young men to war would soon lead to a weakened police force, as indeed it did. Early in the war his gang staged a series of jewellery robberies in the West End, including one in which they smashed their way with a car-jack into Carringtons in Regent Street and made off with £6,000 worth of goods. Within weeks of wartime rationing being introduced, Hill was selling everything from whisky to sausage skins at £500 a barrel. Despite spells back inside, he emerged from the war a wealthy man.

During the blitz, one standard ruse for thieves was to kit themselves out with an ARP (Air Raid Precautions) warden's helmet and armband and smash their way into shops when no one was looking. Such was the power of the armband that the public would dutifully help load up a car, believing that the goods were being removed for safe keeping. Some unscrupulous villains used vehicles disguised as ambulances for their getaways.

But while it was predictable that professional criminals should seek to profit from blitz and blackout, what was more surprising was how many others joined them. Rationing, introduced for food and luxury goods, led to widespread abuse by people who would never have considered themselves lawbreakers. In 1943, in one operation, five million clothing coupons were stolen and the government had to cancel the entire issue. By 1945 more than 114,000 prosecutions for black market activities had taken place, sometimes for remarkably minor and understandable breaches of the law.

Prosecutions for breaching regulations were no respecter of rank. Ivor Novello, composer of the famous first world war song, Keep the Home Fires Burning, was sentenced to eight weeks – reduced to four – in 1944 for the fairly minor misuse of petrol coupons offered to him by a female fan. But perhaps more remarkable was the number of people who took part in another growth industry of the blitz: looting.

Juliet Gardiner, the social historian and author of Wartime: Britain 1939-1945, says that, while most people found looting despicable, examples differentiated between stealing someone's property and spotting a wireless or jewellery lying on the pavement after an air raid and reckoning that, if you didn't take it, someone else would. "Looting can be a rather elastic term," says Gardiner. "There are stories about rescue parties going to a pub and having to dig for bodies, which is a very grisly task; one of the leaders of such a rescue party found a bottle of brandy and passed it round his men to have a swig to stiffen their sinews and he was actually sentenced to six months in prison. It was mitigated on appeal, but it gives you an idea of what a broad spectrum the notion of looting could cover."

In the archives of the Imperial War Museum in London, there are detailed records of people's experiences during the blitz. The Rev John Markham, vicar of a church near the Elephant and Castle and a chief fire warden, was one who kept a detailed log. He described how one "volunteer" warden had offered to join the team. "I made a few discreet inquiries and found out that he was a burglar and that his van was full of tools," wrote Markham, "and that he'd made a point of driving all over the borough, particularly to business premises when they were hit, and diving straight into the ruins to find the safe. His only concern with us was that he wanted the cover of a warden's badge as an identity card." Markham's team would take bodies to the crypt of his church and have them guarded by a warden because otherwise people might steal their wallets or wedding rings.

One trader in east London at the beginning of 1941 reckoned that shopkeepers lost more from crime than they ever did from German bombs. When the Café de Paris, which had a supposedly secure underground ballroom, suffered a direct hit in 1941, rescuers were shocked to find that looters were among them, yanking brooches and rings from the bodies of the revellers.

The courts were kept busy. In December 1940, Sheffield Assizes set aside two days to deal only with looters. And the press were in no doubt as to the heinous nature of the offence. "Hang A Looter And Stop This Filthy Crime!" exhorted the Daily Mirror in November 1940.

There was little the police could do to protect wrecked shops whose smashed windows were often just replaced with cardboard or plywood. Police cars were subject to the same petrol shortages as everyone else and pursuits during the blackout were almost impossible. Bill Biggs, now 100, was a police officer in London during the war and remembers spotting three men breaking into a clothes shop to steal suits and dressing gowns. "Clothing was rationed and to buy a suit you needed any amount of coupons," he explains. "If you could acquire some coupons, you did very well."

Some crimes were related purely to the war: for instance, some doctors took bribes to sign people off as unfit to serve. Canny souls with gammy legs or some other disability, would, for up to £150 a time, assume the identity of someone who had received call-up papers and attend the medical on their behalf, ensuring that they were excused service.

Another scam came into play after every Luftwaffe raid. The government paid £500 to those who had lost their homes through the bombing, plus additional compensation for damaged furniture and clothing. One enterprising chap, Walter Handy, claimed to have been "bombed out" 19 times in a five-month period. His luck eventually ran out and he was jailed for three years. The blackout was also the pickpocket's best friend.

Prostitution flourished. The "Piccadilly commandoes", as they were nicknamed, plied their trade in Soho, catering to the thousands of soldiers about to depart for the front. The relaxed mores of the time were reflected in the ditty I've Got the Deepest Shelter in Town, sung by the cabaret singer, actress and impersonator Florence Desmond: "Please don't be mean/ Better men than you have been/ In the deepest shelter in town." It was a golden era for double-entendre lyrics: rationing prompted the cheery ballad, "Everyone's pinching my butter/They won't leave my butter alone."

The people who attracted less opprobrium but also found wartime a bonanza for crime were the "legitimate" businessmen who realised that they could charge the government pretty much what they wanted for vital services. "The war was regarded by many businesses as a fantastic entrepreneurial opportunity," said Professor Dick Hobbs of the London School of Economics, who specialises in the study of organised crime. "The government was seen by many businesses as fair game for fraud, so all kinds of ghost workers would be put on payrolls."

Hobbs reckons that one side-effect of the war was the change in the public's attitude to crime. "It introduced people to crime and the possibilities of crime that they hadn't necessarily been aware of before, whether it was actually doing the crime itself – going out and stealing or poaching rabbits and selling them to the butcher or the neighbours – or whether it was just buying and selling stolen goods."

However, while the "spivs and drones", as the BBC described them at the time, may have had their "finest hour" and the crime rate increased by 57% from 1939 to 1945, there was never the descent into the kind of civilian lawlessness that has characterised so many other wars over the past half century.

Juliet Gardiner says: "Even though looting and incidents of crime shot up during the war, I still think the British people did pull together."

Bandits of the Blitz, presented by Duncan Campbell, is broadcast on BBC Radio 4 on 8 September at 11am.