Donald Trump earlier denounced French President Emmanuel Macron's "foolishness". (Reuters)

France wants to reach a deal with the US on taxing tech giants by a G7 meeting in late August, Economy Minister Bruno Le Maire said Saturday.

He was responding to US President Donald Trump, who on Friday vowed "substantial" retaliation against France for a law passed this month on taxing digital companies even if their headquarters are elsewhere.

The law would affect US-based global giants like Google, Apple, Facebook and Amazon, among others.

Trump denounced French President Emmanuel Macron's "foolishness", though they discussed the issue by phone on Friday, according to the White House.

Macron confirmed that he had a "long" conversation with Trump, stressing the pair would "continue to work together in view of the G7".

"We will discuss international taxation, trade and collective security", he said Saturday.

His office earlier said Macron had told Trump that the tax on the tech giants was not just in France's interest but was something they both had a stake in.

Neither side revealed if they had also discussed Trump's threat to tax French wines in retaliation.

Le Maire took the same line at a news conference Saturday: "We wish to work closely with our American friends on a universal tax on digital activities.

"We hope between now and the end of August -- the G7 heads of state meeting in Biarritz -- to reach an agreement."

Leaders of the Group of Seven highly industrialised countries are to meet in the southwestern French city on August 24-26.

Plugging a taxation gap

Le Maire emphasised that "there is no desire to specifically target American companies," since the three-percent tax would be levied on revenues generated from services to French consumers by all of the world's largest tech firms, including Chinese and European ones.

But Deputy White House spokesman Judd Deere noted earlier that France's digital services tax was already the subject of an investigation at the US Trade Representative's office, potentially opening the door to economic sanctions.

"The Trump administration has consistently stated that it will not sit idly by and tolerate discrimination against US-based firms," Deere said in a statement.

The French law aims to plug a taxation gap that has seen some internet heavyweights paying next to nothing in European countries where they make huge profits, because their legal base is in smaller EU states.

France has said it would withdraw the tax if an international agreement was reached, and Paris hopes to include all OECD countries by the end of 2020.

The Organisation for Economic Co-operation and Development is a Paris-based forum that advises the world's advanced economies.