Prices for houses located in a hamlet or village rose 9.6%, compared to 9% in towns, 7.8% in cities excluding London, and 5.1% in London.
House prices increased faster than the price of flats across the board, as the price of flats in towns fell during the pandemic, while the price of semi-detached houses in towns rose the most.
House price statistics for small areas in England and Wales for the year ending December 2020 showed that the median house price in England and Wales in 2020 was £250,000.
England had a median price of £259,000, while Wales had a median price of £170,000.
Houses with three or more bedrooms rose faster in price than smaller houses, and those prices in coastal towns grew faster during the pandemic than towns inland.
The average price of properties in towns in 2020 ranged from £39,000 in Ferryhill, County Durham to £1m in Northwood, North London.
Six in 10 towns with the highest average house prices were in the South East, while six in 10 with the lowest were in the North East.
The town with the highest median price in Wales in 2020 was Dinas Powys, Vale of Glamorgan, with a median house price of £291,000, while Ferndale had the lowest at £60,000.
All of the bottom 10 were former industrial and mining towns in either the North of England or South Wales and between 2010 and 2020, a third of towns in the North East saw falling house prices.
Sarah Coles, personal finance analyst at Hargreaves Lansdown, said: “The race for space during the pandemic drove us out of cities and poky flats into bigger family homes in towns by the seaside.
“The trend was powerful enough to reverse the decline we’d seen in coastal towns over the previous decade.
“Buyers spurned cities and snapped up homes in towns and villages.
“We also embraced the fresh sea air, and coastal towns saw prices outstrip those further inland.
“It’s likely that we prize the open air more highly now. We’re also prepared to do longer commutes to be beside the seaside when we get home, especially now more of us are moving to working from home for at least part of the time.
“The pandemic has also seen us fall out of love with apartment living. Months of lockdown convinced us that compromising on space both indoors and out was too high a price for living in the centre of things.
“This was particularly the case outside cities, because the price of flats in towns actually fell during the pandemic.
“Meanwhile, bigger houses, with three bedrooms or more, boomed in price, as more of us started to understand the allure of the home office.
“We were willing to compromise on the seclusion of a detached home to get more space for our money, so semi-detached properties in towns gained the most value during the year.”