Media playback is unsupported on your device Media caption Ofgem director Philip Cullum: "We want suppliers to show more responsibility"

The "big six" energy firms have been told to hand back more than £400m owed to customers.

Credit left in customer accounts when people and businesses move or switch suppliers has accumulated over the last six years, Ofgem said.

The energy regulator, which says its estimates are the minimum owed, has called the amount "unacceptably large".

It thinks 3.5 million domestic and 300,000 business accounts are affected.

"When many people are struggling to make ends meet, it is vital that energy companies do the right thing and do all they can to return this money and restore consumer trust," said Andrew Wright, chief executive of Ofgem.

"We want to see decisive action by suppliers, individually and collectively, to address this issue."

Alerting customers

Ofgem estimates the suppliers hold at least £202m from former domestic customers and at least £204m from old business accounts.

The regulator says it is investigating whether suppliers' policies on returning money to customers comply with existing rules.

In cases where the money cannot be returned, the regulator expects companies to "find ways to use this money to benefit consumers more generally" and clearly explain what they have done with it.

Customers need to be aware of the problem of outstanding credit, said Sarah Harrison, senior partner in charge of enforcement at Ofgem.

"We're using the opportunity to alert customers," she told the Today programme on BBC Radio 4. "Make sure that you take with you what is owed to you when you change supplier."

Media playback is unsupported on your device Media caption Energy UK boss Angela Knight: Firms 'need details' to refund

The body that represents the suppliers, Energy UK, said returning credit balances can be difficult because some customers leave no new contact details when they move house, or they have no details of next of kin when people die.

Its spokeswoman, Angela Knight, urged customers to keep their energy suppliers informed, and told Radio 5 live that suppliers would like to return the money to customers.

"We want to give the money back, of course we do," she said. "Thousands of letters are sent out, people are telephoned, but if you don't have contact details, how do you find them?"

One of the big six energy suppliers, SSE, said it was having to write off four times as much money, in bad debt for departing customers, as it was retaining in the form of unreturned credit.

"Although sometimes customers do disappear and cannot be traced, we always view any credit as theirs and, no matter how much time passes, if they come forward and we can identify an outstanding credit, we will return it to them," said the company, which trades as Southern Electric, Scottish Hydro, SWALEC & Atlantic.

"We're happy to work with anyone who has legitimate suggestions for how we can find customers more easily and efficiently," it added.

Ofgem's call comes after most of the "big six" energy firms agreed to automatic refunds for direct debit customers when they are in credit.