Scientists have developed a new technique for recovering precious metals without using toxic chemicals.
The team believe their method could help salvage some of the estimated 300 tonnes of gold used in electronic circuitry every year.
Electrical waste is thought to contain as much as 7% of the world's gold.
Existing methods of extracting gold from circuit boards are inefficient and potentially hazardous as they involve toxic chemicals such as cyanide, the researchers said.
By studying the chemistry underpinning the extraction, the team said they were able to develop a compound that could be used to recover gold more effectively.
Circuit boards are first immersed in a mild acid which dissolves their metal parts.
An oily liquid containing the compound is then added, which extracts the gold from other metals.
Prof Jason Love, from the university's school of chemistry, said the discovery could help reduce the environmental impact of gold mining.
He said: "We are very excited about this discovery, especially as we have shown that our fundamental chemical studies on the recovery of valuable metals from electronic waste could have potential economic and societal benefits."
The study, published in the journal Angewandte Chemie, was funded by the Engineering and Physical Sciences Research Council.
Large quantities of gold could be recovered from old mobile phones, according to researchers at the University of Edinburgh.