While not every buyer has the luxury of choosing anywhere in the country to live, the rise of remote work before and during the pandemic gives more people flexibility.

Recent analysis of search patterns by Redfin real estate brokerage found that 31.2 percent of Redfin.com users in January and February were looking to move to a different metro area, the highest share since it started tracking migration trends in 2017. In addition, that percentage is up from 26.1 percent of Redfin.com users looking to relocate in January and February 2020.

For first-time buyers, affordability is often a factor in where they choose to purchase their first home. A recent analysis by Realtor.com identified the top 10 markets where first-time buyers will find more affordable homes as well as job opportunities if they are not working remotely.

Approximately one-third of home buyers are first-time purchasers, and many of those buyers are millennials between the ages of 25 and 34, according to the National Association of Realtors. Realtor.com identified six factors that could make a housing market more attractive to first-time home buyers: housing prices relative to local incomes, the share of 25- to 34-year-olds living in the market, the availability of homes for sale, job opportunities, distance to work, and amenities such as bars and restaurants.

Researchers limited their findings to one city per state to increase geographic diversity, but four of the top 10 markets are in the Midwest. The analysis found that Bloomington, Ill., offers the best opportunities for first-time buyers, followed by Iowa City; Kalamazoo, Mich.; Great Falls, Mont.; Eau Claire, Wis.; Savannah, Ga.; Schenectady, N.Y.; Taylorsville, Utah; Harrisonburg, Va.; and Rapid City, S.D.

One reason these locations are particularly attractive to first-time buyers is the median home price. In every city, the median home price is below the national median price of $370,000, according to Realtor.com. For example, the median listing price in March for a home in Bloomington was $160,000. The lowest median listing price, $155,000, is found in Kalamazoo. The highest median listing price among these top 10 markets is $350,000 in Taylorsville.

For nine of these top 10 markets, the presence of a four-year college or university is likely to contribute to the more youthful population. Among the top 10 markets, Savannah has the largest share of adults ages 25 to 34 at 16.9 percent of the city’s total population.

While affordability is important, for many first-time buyers the frustration of a lack of homes for sale is driving their interest in moving to a new metro area. Buyers will find the most listings among these markets in Schenectady, which has nearly 18 listings per 1,000 households, followed by Iowa City at 13.3 listings and Savannah at 12.1 listings.

For the Redfin report, click here.

For the Realtor.com report, click here.

Read more in Real Estate: