HSBC and JPMorgan are in talks to relocate parts of their businesses to Luxembourg from the UK as they weigh the possibility of a British exit from the European Union, according to reports.

JPMorgan is close to setting up a bank based in Luxembourg to handle the clearing of eurozone transactions, paving the way for the U.S. bank to transfer more of its business out of the UK in the event of a Brexit, according to the Times of London.

The banks are also considering the tougher rules imposed by the European Union for conducting business outside of the eurozone. The changes are not likely to lead to a large number of jobs moving to Luxembourg and London would remain the European headquarters of JPMorgan for the present, the Times said.

Representatives at HSBC and JPMorgan were not available for comment outside regular business hours.

A British exit, known as a Brexit, would take some time to implement after a vote to leave, JPMorgan said in a research note last week, adding that the uncertainty over an exit could hurt business sentiment, investment decisions and headline growth.

"The transitional costs are likely to be substantial, as uncertainty over future arrangements would likely cause investment to fall and consumers to defer spending," said the bank, which has assets of $2.6tn.

HSBC is understood to have told the UK Treasury that it was considering moving its headquarters to Luxembourg from London, and the discussions with officials are part of the its domicile review announced in April, the Times reported.

Shareholders had in April urged HSBC, Europe's biggest bank, to consider moving its headquarters to Asia due to a hefty UK bank tax and other costs associated with being based in London.

Reuters had reported in March that Asia-focused banks Standard Chartered and HSBC could be tempted to abandon their London headquarters to avoid a jump in the UK bank tax set to cost them a combined $2 billion a year.

More than 300 companies, including PepsiCo, AIG and Deutsche Bank, secured secret deals from Luxembourg to slash their tax bills, the International Consortium of Investigative Journalists (ICIJ) reported last year, quoting leaked documents.