The great transition from showing up at an office every day to working from home probably will persist even after the Covid virus fades into an accepted fact of life.

Some people have found they like the discipline of the office routine and the comradery of being with co-workers. But others have enjoyed the freedom and flexibility of working from home and conducting business online and through video programs. Many companies are enacting hybrid schedules for employees.

While the country has now reopened as the impact of the Covid virus has lessened, plenty of workplaces are keeping a work-from-home structure. About 20% of all professional jobs were remote as of the beginning of 2022, according to WalletHub, a personal finance website based in Washington, D.C.

“While more and more businesses are embracing work-from-home positions, people who are allowed to work from home may not always have the best environment for doing so. The best work-from-home conditions include low costs, reasonable comfort, and a high level of security,” WalletHub said.

The ease with which people can work from home depends on a number of factors, many of which revolve around the internet, and the quality and speed of the internet can depend on where a person lives

WalletHub ranked the 50 states and the District of Columbia to determine the best and worst locations for working from home taking into consideration the work environment and the living environment. Those two general topics were broken down into a number of factors, such things as the percentage of workers working from home before the pandemic, to internet cost and cybersecurity, to how crowded homes are in different states. The factors were weighted to come up with the final ranking. Each state is weighted on all factors to come up with the final ranking, so a state that is first in one metric may not end up number one for the total ranking.

Following are WalletHub's five best and worst states for working from home and some of the factors behind the rankings:

The Best:

5. Massachusetts

The state has the highest percentage of homes with internet access.