Firms in those cities show they sell a higher proportion of exports to customers within the EU, than the UK average, as does Newport as well.
The Centre for Cities said its research illustrates how the UK's cities are critically dependent on EU markets.
It found 61% of exports from Cardiff are sold to customers in the EU.
This compared with 17% to the United States and 1% to China.
Swansea follows a similar pattern: 60% to the EU, 15% to US and 2%, while Newport is not in the top 10 but still sells 56% of exports to EU, 17% to the US and 2% to China.
The report says that Welsh cities would need to dramatically increase their trade with parts of the globe beyond the EU to compensate from any downturn once the UK leaves the Single Market.
It suggest the UK would have to double exports to China or increase sales to the US by one third.
The industries most tied into the EU are particularly are interesting.
Iron and steel dominate, accounting for more than third of exports from Cardiff and Swansea, followed by insurance and financial services which account for about one sixth.
Paul Swinney, principal economist with Centre for Cities said the EU market was of "crucial importance" to Cardiff, Swansea and Newport.
"When it comes to Brexit and trade deals we have to prioritise getting the best possible deal with the EU compared with any other country in the world.
"It's right to be ambitious about trade deals with the US and China, but the EU still accounts for the vast majority of our exports, so we have to be thinking of getting that deal right first if we're going to protect and grow jobs in places like Cardiff and Swansea."
Welsh Secretary Alun Cairns, speaking after a meeting of the joint ministerial committee (JMC) in Cardiff, said there had been "positive engagement, particularly around international trade".
He said the Welsh Government's call for "full and unfettered" access to the single market was "not inconsistent" with the UK government's desire for a free trade deal without membership.
"We're determined to take every part of the United Kingdom with us as we negotiate to exit the European Union," he said.
Cardiff and Swansea are amongst the 10 UK cities most dependent on trade with the European Union, according to research from a think-tank.