Think about the amount of food left uneaten every night by every household in the UK.

Now add the slops from schools, hospitals, restaurants, catering companies and unsold, out-of-date food from retailers. UK households are directly responsible for 6.7 million tonnes of food waste each year, most of which goes to landfill.

The food and drink industry is almost as bad, producing 5.6 million tonnes, according to Waste and Resources Action Programme (Wrap). Yet food waste need not go to waste. It could be used to generate electricity - as a growing number of grocery retailers and manufacturers are discovering.

Marks & Spencer, Northern Foods, chef Raymond Blanc and Bradgate Bakery, which makes sandwiches for Tesco and Ginsters, are some of the names experimenting with biogas technology in a bid to put the methane emitted by food waste to better use.

Others, such as Sainsbury's and the John Lewis Partnership, are also looking at how to close the so-called food loop - by powering stores with energy derived from waste generated by the very food they sold in the first place.

You don't have to look far to see why biogas plants - or anaerobic digesters as they are also known - have become such big news.

The UK throws out more food waste than packaging every year. The industry alone is responsible for more than a quarter of the UK's 20 million tonnes of food waste and has been heavily criticised by environmental campaigners, not just for this but also for its indirect role in increasing household waste. Indeed, about £250- £400 of a household's annual shopping ends up going to waste, estimates Wrap.

Much of this cannot be sent to landfill any longer. EU directives dictate that businesses reduce biodegradable waste sent to landfill to half their 1995 levels by 2013.

And those that do still use landfill have to pay for the privilege. As a deterrent, the tax for sending waste to landfill has been increased by £3 a tonne every year since 2001. From April this year it will rise by £8 per tonne every year for three years so that by 2011 it will be a whopping £48 per tonne.

Local councils and businesses are, needless to say, frantically looking for alternative ways to dispose of this waste. Biogas plants could present one such solution - not least because it could handle waste generated by consumers as well as directly by the food and drink industry, killing two birds with one stone.

Marks & Spencer is the first major food retailer to make use of energy from anaerobic digestion (AD). In a groundbreaking scheme sponsored by the retailer, 5,000 tonnes of uneaten food from homes in Ludlow, South Shropshire, are being used to fuel a Ludlow food waste plant run by specialist treatment company Greenfinch. 

M&S has agreed to pay Greenfinch for converting enough residential waste into electricity to power the equivalent of six of its local Simply Food stores.

It is also working with Dorset farmer Owen Yeatman to process farm waste. Yeatman is building an AD plant, due to open in the spring, that will use farm waste and energy crops, creating a new income stream for him. The farm slurry would usually be piled up for long periods of time, generating methane emissions.

"There are easier wins [than household waste], like collecting farming and food manufacturing waste," says Mike Barry, M&S's corporate social responsibility manager. "A good place to start is with your farm suppliers, which then allows you to develop a critical mass around the UK."

In Germany, which relies on fossil fuel imports far more than the UK, the use of biogas via farm waste has grown substantially in recent years. M&S has drawn on this experience by taking 27 farmers to Germany as well as arranging educational workshops for them.

Biogas is a double win, says Barry, because it not only helps cut its fossil fuel use, it also helps promote environmentally friendly waste disposal among its customers and suppliers. Initiatives such as these could be the first important step in closing the food loop, says Barry, who makes it clear that M&S is prioritising its investigation into biogas over other biofuels. It has not ruled out the possibility of buying its own AD plant, he adds.

Others are equally convinced about the long-term opportunities presented by biogas. Richard Swannell, director of market development at Wrap believes AD is key to "unlocking the hidden value in food waste" as well as being vital to the fight against climate change.

David Collins, biogas spokesman for the Renewable Energy Association (REA), adds: "The retailer's role should be to buy electricity from biogas plants that digest their own waste, and to encourage the spreading of bio fertiliser from plants to land on which their crops are grown."

But at the moment the infrastructure is not in place for take-up to grow rapidly. "There are only seven biogas plants of this sort in the UK," says Kate Cawley, business development manager at waste management company Cawleys. "We currently only have the capacity to process about 50,000 tonnes a year. It's not a lot but politicians should be getting on side with biogas because it hits all the right buttons."

For one, the AD process is carbon negative. It will also provide a cheaper alternative to landfill as taxation on the latter rises, she says.

Despite the current lack of scale, people are starting to catch on. Cawleys manages 4,000 tonnes of general waste per week, 350 tonnes of which is food waste - enough to power 12 houses for a year. Its customers include food manufacturers, hotels, restaurants and catering companies. Raymond Blanc uses Cawleys' biogas facilities near Bedford to manage waste from his brasserie in Milton Keynes as does Hain Celestial, which provides sandwiches to M&S.

The process by which electricity is generated from the waste is fascinating. First, the waste is picked up by Cawleys' fleet of 100 trucks, which collect daily from Monday to Saturday.

When it arrives at the biogas processing plant it is mixed with pig manure and then pasteurised to kill any bugs. The waste - which at this stage resembles a thick soup - is then fed through a fermenter, which Cawleys' business development manager Kate Cawley likens to "a giant stomach".

In the fermenter the natural bacteria feeds and reproduces to create methane. The methane is transferred to a generator that produces electricity and pumps it into the national grid. A side product of this process is a liquid nitrate fertiliser, which is given to local farmers for their fields.

It's difficult to think of any down sides. Yet, the customers Cawleys would most like to see sign up are proving elusive.

"We want the business of the supermarkets in our area. We want to process their unsold, out-of-date and damaged food. We are in talks with the John Lewis Partnership and Sainsbury's," says Cawley. "But we've had no interest from Tesco as yet. They all seem to want a national solution, a single contract for their entire business, but that national solution doesn't yet exist."

Instead, Tesco is investing in solar panels and other renewables at its stores, while Sainsbury's and the Co-operative Group have opened green power accounts with utilities. And Waitrose has also improved its energy efficiency.

However, Cawley is confident that biogas will reach a tipping point, making wider take-up inevitable. "We're small, fast and innovative," she says. "I believe that in the future companies like us will help power food retailers with their own waste via biogas plants on site. It would be fantastic and would help us get closer to our target of zero waste to landfill."

The good news is that there has been a groundswell of support for biogas over the past few months. And improved government biogas funding expected in 2009 is likely to provide further incentives to a sector that, according to REA, is poised to take off.

Experts are looking for other retailers to engage with biogas with the same sort of zeal M&S has shown. Barry hopes that others follow its lead. "We can provide potentially huge support to show how the technology works and how the finance could stack up," he says.

If they do, closure of the food loop could be a very real prospect - and the benefits won't just be greener energy.

As Dax Lovegrove, head of business and industry relations at environmental charity WWF, points out: "If one retailer is better and more efficient, that's where we would be shopping."