All around the world people are living digital lives, making it easier to live, work and retire almost anywhere. For people living abroad, digital access is paramount, whether it's to stay in touch with friends and family back home, master administrative challenges in a new country, or to work remotely.

Some of the Scandinavian countries excel at offering a digital environment, while at the other end of the spectrum, expats in countries such as China and Egypt struggle with a lack of government services online, difficult access to high-speed internet at home, or even restrictions in their use of online services, according to a survey by InterNations, an online expat community.

In its "Digital Life Abroad Report," InterNations identifies the best and worst countries to live a connected life. InterNations surveyed 18,135 expats around the world, representing 178 nationalities in 187 countries and territories, asking about leisure options, health and well-being, safety and security, personal happiness, travel and transportation, and digital life.

The survey asks expats about cost of internet, access to high-speed internet at home, availability of government and other online services, and cashless payment options in the country where they live.

Based on the InterNations report, these are the best and worst countries to live a digital life.