Living by the sea makes you among the happiest people in Britain with coastal resorts taking the top two slots in a national happiness index.

Residents of Leigh-on-Sea in Essex are the most content, followed by Troon in Scotland. In the north west, Lytham St Annes is fifth in the top 10, thanks to community spirit and feeling safe.

Almost 24,000 people across Great Britain took part in Rightmove’s Happy at Home Index, which asked residents to rank 12 factors about their local area, ranging from how friendly the neighbours are and how much people feel that they can be themselves, to how good the local services are.

Leigh-on-Sea scored high for community spirit and a strong sense of belonging, and locals say there’s plenty to do as well as the town tops the list for good access to sports and arts activities and opportunities to develop skills. The ripple effect of rising house prices out from London to the commuter belt has led to a 15 per cent increase in asking prices in Leigh-on-Sea over the past year, to £384,439.

The picturesque spa town of Harrogate has come top for the past three years, and although it’s been knocked off the top this year by the lure of the seaside, it has still made it into third place, with its beautiful green spaces helping its happiness ranking.

Rightmove’s Abiola Oni said: “Obviously what happy means to different people can vary greatly, but when you compare which factors score highest in the happiest areas, it shows just how important having friendly people in the local community area is alongside the services and amenities, which buyers often look for when they are house-hunting in new areas.

"Space is also one of the most important things when people are looking for a new home, so it’s not surprising that places with open spaces such as beautiful parks and beaches have featured in the top 10.”