Thousands of “accidental landlords” could be clobbered with much higher tax bills when they come to sell their properties as a result of measures in the budget.

Based on the government’s own scenario, someone selling a property they once lived in – but then rented out for a while – could typically end up more than £13,000 worse off than under the current rules.

This all relates to two changes announced by the chancellor, Philip Hammond, on Monday that sound fairly technical and esoteric, but which could have a big impact on some people.

That could include those who have had to relocate for work or have separated from their partner or moved in with a new partner, and who either didn’t want to sell up immediately or were unable to find a buyer.

Ian Dyall at financial planning firm Tilney says this week’s announcement is “another nail in the coffin for buy-to-let” following the 3% hike in stamp duty on second homes and the cut in tax relief on mortgage interest payments for buy-to-let landlords.

Meanwhile, Sam Mitchell at online estate agent Housesimple says: “Anyone who rented out their previous home and has equity locked up in that property will now be thinking it’s best to sell sooner rather than later if they want to avoid a massive capital gains bill further down the line.”

So what has the government done?

When you sell a property, you may have to pay capital gains tax (CGT) if you have let it out. How much you pay depends on how long you lived there. You pay tax on your “chargeable gain”, which is your gain, minus any private residence relief (PRR) you are eligible for. PRR is the tax relief that keeps people’s main homes out of the CGT net.

At the moment you don’t have to pay any CGT for the years you lived in the property, plus an additional exemption for the final 18 months that you owned it, even if you weren’t living there at the time.

But Hammond announced that from April 2020 this final period exemption will be cut to nine months. (There will be no change to the 36 months available to disabled people or those in, or moving into, a care home.)

The other change is arguably a bigger deal and involves something called lettings relief, which currently provides up to £40,000 of relief (£80,000 for a couple) to people who let out a property that is, or has been in the past, their main home. From April 2020, lettings relief will only apply where the owner is sharing occupancy of the home with a tenant – effectively spelling the end of this perk.

So how will the new regime affect people? The HM Revenue & Customs website gives an example of what happens at the moment. An individual – let’s call him Mr B – makes a gain of £120,000 when he sells a property he has owned for 12 years. He lived there for the first six years, then let it out for the next six.

He gets PRR for the first six years, plus for the last 18 months, even though he wasn’t living there then. That means he gets PRR for 7.5 of the years (62.5% of the time) he owned the property. As a result, he won’t pay tax on £75,000 of the gain. The remaining 37.5% (£45,000) of the gain not covered by PRR is his chargeable gain.

But then lettings relief kicks in. At the moment Mr B can claim that valuable £40,000 in lettings relief. That means he will pay CGT on £5,000 – resulting in a likely tax bill of just £1,400, says Suzanne Briggs, a partner at accountants Blick Rothenberg.

But once the April 2020 changes – the effective end of lettings relief and the reduction in final period exemption – take effect, the maths look very different. The £75,000 figure above falls to £67,500, which means a higher chargeable gain of £52,500. Crucially, no lettings relief would be applied in this example. That means Mr B gets clobbered with a CGT bill of £14,700 (assuming all of his gain was taxed at 28%), says Briggs.

“Thus, from April 2020, the taxpayer in the example would be £13,300 worse off,” she adds.

However, the Treasury says it is keen to “better focus private residence relief at owner-occupiers”.

It adds that under the current system people can claim lettings relief on a property even if they have not lived in it for a long time. And it points out that the lettings relief change will not affect owner-occupiers or landlords who have never lived in the property they are renting out.