The UK government announced on Monday that it will impose a "digital services tax" on big tech firms.

The tax would come into force from 2020, and the UK's spending watchdog predicted that the levy would bring in a total of £1.6 billion ($2 billion) by 2024.

It's difficult to estimate how much each company would have to pay in taxes thanks to their complicated reporting structure.

Using each company's UK filings, Business Insider estimates the tax could take up to £40 million ($51 million) each from firms including Facebook, Amazon, and Google.

The British government has signalled that the days of big tech firms paying tiny amounts of tax are over.

In a strategy that puts the UK one step ahead of the US and European Union for now, British Chancellor Philip Hammond announced a new "digital services tax" on Monday.

The new levy will involve firms such as Facebook, Amazon, and Google paying 2% on the revenue they make from UK users and activity. Tax is usually paid on profits, but because these companies use complex financial arrangements to record minimal profits in Britain, their corporation tax bill has traditionally been low.

For example, Amazon paid just £4.6 million ($6 million) this year in UK corporate tax, down from £7.4 million in 2016. This was after posting UK revenues of nearly £2 billion.

Britain's spending watchdog, the Office for Budget Responsibility (OBR), said up to 30 companies would be impacted by the digital services tax, which will apply to firms generating at least £500 million ($638 million) in global revenue. The levy would kick in from April 2020.

The OBR forecasts that the scheme will extract $300 million in extra tax from tech firms in its first year, rising to £400 million in 2021/22, and £500 million by 2024. Over the four years, that totals £1.6 billion ($2 billion) for the Treasury's coffers. And it would mean an average revenue tax bill of up to £16.6 million a year for the 30 companies.

Trying to establish how much companies like Amazon or Facebook will pay after this new tax comes into force is difficult. Most of the companies don't actually break out the money they make from UK users, instead adopting opaque, tax-efficient structures in different countries. The Treasury says the digital services tax will work on a self-assessed basis, meaning Facebook and others will do the maths in-house.

We don't have a reliable proxy for how much the Silicon Valley giants make from UK users. All post financial results to the UK's Companies House, but those don't necessarily reflect revenue from British users.

According to Companies House, Facebook and Google each reported UK revenues of approximately £1.3 billion for 2017, while Amazon UK's turnover was roughly £2 billion. If they were taxed 2% on these revenues, it would lead to bills of £26 million and £40 million respectively.

It's possible the bills could be much steeper. According to a Fortune investigation several years ago, Google booked €18 billion in non-US revenue through its Irish subsidiary in 2014. Assuming most of that came from the UK, that would have meant a tax bill of as much as €360 million (£320 million).

Still, that's a drop in the ocean for companies like Amazon and Google whose global revenues run to hundreds of billions of dollars.

Some UK politicians think the digital services tax doesn't go far enough. "The tech giants do need to pay more in tax, but the measure announced today is pittance for these massive international companies," said Labour's deputy leader Tom Watson.

And the OBR acknowledges that its own forecasts are currently sketchy, as it designated the estimates as carrying "high uncertainty." Chancellor Philip Hammond also did not detail exactly how the tax would work.