Wood Mackenzie said tax relief on scrapping platforms and pipelines would "wipe out" the government's expected future income from the North Sea.
The figure is in line with previous industry estimates but higher than the Treasury's forecast of £16bn.
The Treasury said forecasts would differ given timing uncertainties.
The Wood Mackenzie report said: "Decommissioning is arguably the single biggest issue in the minds of those interested in UK oil and gas right now, weighing on operators, oilfield services companies, prospective asset buyers and sellers.
"There are a number of uncertainties surrounding this market, from fundamental questions such as how much will it cost, when will it happen, through to what happens if someone defaults on their liabilities.
"There are, mercifully, some certainties in the decommissioning sector. The UK has stringent regulations that set out the obligations of what needs to be removed, how to handle companies defaulting on obligations and decommissioning relief deeds which guarantee the rate of tax relief."
It added: "It is clear that no one is in a hurry to decommission and no one is rushing to pay for it.
"There is a clear mutual benefit for government and industry to achieve cost savings in decommissioning projects and extend the productive life of assets."
A Treasury spokesperson said:  "The oil and gas industry has contributed £330bn in taxes since production on the UK Continental Shelf (UKCS) began.
"We're committed to maximising the recovery of the UK's oil and gas while ensuring a fair return for the nation.
"We provide tax relief for the decommissioning of oil and gas infrastructure, whilst also working with industry and the OGA (Oil and Gas Authority) to reduce decommissioning costs."
UK taxpayers face a £24bn bill to decommission offshore oil and gas infrastructure, according to independent analysts.