We’ve all been there: Shopping around for hours to find the best deal on holidays or theatre tickets, only to see the price driven up at the last minute by hidden credit card fees.

That sinking feeling is about to be consigned to history as the government introduces new legislation to end credit card fees forever.

‘Surcharging’ has become as commonplace as the Visa sign itself in recent years, with businesses as diverse as takeaway apps to travel companies all charging extra for paying by credit card.

Some consumers have reported being charged as much as 20% extra when paying for flights.

The economic secretary to the treasury, Stephen Barclay, said the charges would be made illegal from January 2018 as part of the government’s drive to help families cope with the rising cost of living.

He added: “Rip-off charges have no place in a modern Britain and that’s why card charging in Britain is about to come to an end.

“This is about fairness and transparency, and so from next year there will be no more nasty surprises for people at the check-out just for using a card.

“These small charges can really add up and this change will mean shoppers across the country have that bit of extra cash to spend on the things that matter to them.”

The move follows government EU legislation introduced in 2015 to cap the cost of processing credit card payments for businesses.

Steven Barclay said the government would continue working with retailers to see if more could be done to reduce costs.

The new rules will also clamp down on surcharging by local councils and government agencies.

In 2010, the total value of surcharges for debit and credit cards was an estimated £473 million.