The UK energy regulator said credit had been allowed to sit in people and business accounts over the last six years, with many customers moving on to another supplier unaware of the funds still sitting in their account.
Ofgem chief executive, Andrew Wright, said: "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.
"We want to see decisive action by suppliers, individually and collectively, to address this issue"
The £400m figure is based on a minimum estimate Ofgem has stated, with at least £202m held from domestic energy consumers and a similar amount (£204m) from business accounts.
The energy regulator is now also investigating whether suppliers' policies for returning any money to customers are up to scratch and comply with the existing rules.
Energy UK chief executive, Angela Knight, said she understood the customers frustration at missing out on the money, but often suppliers were not kept updated on contact details. She urged energy consumers to always keep their energy supplier up to date on such matters.
She said: "We want to give the money back, of course we do.
"Thousands of letters are sent out, people are telephoned, but if you don't have contact details, how do you find them?"
A spokesperson from 'Big Six' supplier SSE also added another complication, bad debt. They suggested the firm was actually writing off four times the amount of money in bad debt for leaving customers as it was holding in unreturned credit.
The spokesperson said: "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.
"We're happy to work with anyone who has legitimate suggestions for how we can find customers more easily and efficiently."
Latest gas and electricity news brought to you by UK Power - the energy price comparison site.
Click here to run an energy price comparison, and see if you could be paying less for your gas and electricity.