Barclays, the Royal Bank of Scotland and HSBC are among the top banks that have lent billions of euros to the coal sector – despite their much-vaunted environmental credentials, a new investigation has found.

Financing coal is controversial, because it is the dirtiest fossil fuel and responsible for billions of tonnes of emissions of carbon dioxide globally, as well as other pollutants such as soot particles and mercury.

The list of top 20 institutions that have financed coal-mining and coal-fired energy generation reads like a roll-call of the world's biggest banks, with three American banks – JP Morgan Chase, Citigroup and Bank of America – topping the list. Between them, these three have provided at least €42bn to the coal sector since 2005.

Barclays took fifth place, having lent more than €11.5bn to big coal companies in the last seven years, while RBS came in seventh having lent or raised finance amounting to nearly €11bn over the period. HSBC just scraped into the top 20, with €4.4bn of finance.

The research was compiled by a group of NGOs, including German environmental group Urgewald, the international network BankTrack and Earthlife Africa Johannesburg. It took experts more than seven months to uncover the data, because banks do not declare it publicly – many banks do not know how much they lend or raise finance to the coal sector, or how many shares or other assets they own in coal. The figures were found by examining the public reports of the biggest coal mining and coal-fired power generation companies, and the true finance figures are likely to be much higher.

The NGOs have labelled the banks "climate killers" because their financing efforts have helped to expand coal in the past decade. Many of the banks on the list subscribe to environmental principles, such as cutting their own greenhouse gas emissions and conducting environmental impact assessments on projects they finance.

Heffa Schücking of Urgewald said: "We chose to look into coal financing as coal-fired power plants are the biggest source of man-made carbon dioxide emissions and the major culprit in climate change. In spite of the fact that climate change is already having impacts on the most vulnerable societies, there is an abundance of plans to build new coal-fired power plants."

Shücking said shareholders in the listed banks should be concerned, because financing dirty fuels was increasingly risky in the face of the growing threat of climate change, and increasing moves to limit greenhouse gas emissions under national regulations.

She added: "If banks provide money for these projects, they will wreck all attempts to limit global warming to 2C [which scientists regard as the limit of safety]."

The figures include bank lending to coal companies, equity financing raising for the companies, and other sources of financing such as bond issues, as well as coal assets owned by the banks – including physical assets such as coal mines or power plants, and shares in coal companies. The researchers examined the annual reports of coal companies making up 44% of global coal production, and 51% of global coal-fired energy generation, between 2005 and September 2011.

Several banks told the Guardian they did not track how much they lent to the coal sector, and that such lending did not affect their environmental commitments.

RBS said: "Since 2006, RBS has lent more money to wind power projects than to any other type of energy project. Just as society as a whole has to make a transition to renewable energy sources, so will the banks that fund energy production. RBS has been one of the most active banks in the world in funding renewable energy so we are at the forefront of helping finance that transition."

Mary Church, campaigner at Friends of the Earth Scotland, said: "Since the bailout in 2008, it's taxpayers' money that RBS has been investing in this devastating industry."

The top 20 'climate killer' banks

1 JPMorgan Chase

2 Citi

3 Bank of America

4 Morgan Stanley

5 Barclays

6 Deutsche Bank

7 Royal Bank of Scotland

8 BNP Paribas

9 Credit Suisse

10 UBS

11 Goldman Sachs

12 Bank of China

13 Industrial and Commercial Bank of China

14 Crédit Agricole / Calyon

15 UniCredit / HVB

16 China Construction Bank

17 Mitsubishi UFJ Financial Group

18 Société Générale

19 Wells Fargo

20 HSBC

• Data provided by Profundo