Many companies featured on Money advertise with us. Opinions are our own, but compensation and
in-depth research may determine where and how companies appear. Learn more about how we make money.

Still think millennials can't buy homes? You might just be looking in the wrong places.

After all, those under the age of 38 now make up the largest share of all home buyers, according to the National Association of Realtors. And, although millennials prefer to live in cities, data show it pays when they look outside of the nation's pricey urban centers when it's time to settle down.

To help pinpoint the most millennial-friendly places in the U.S., we compared median home prices for every state, provided by Attom Data, to median salary data for those between the ages of 25 and 44 from the Census Bureau. (To be sure, it's not an exact match. Pew Research Center defines millennials as those between the ages of 22 and 37.) The results highlight places where the average home is most affordable to the average young person.

In states like Ohio, Iowa and Indiana, millennials should have a comparatively easy time joining the ranks of home owners — a theory supported by the high share of millennials in those mortgage markets. Young would-be buyers in Hawaii, California and Oregon, however, are far more likely to struggle.

While some states' rankings may be a no-brainer, others, like New York and New Jersey, might come as a surprise. In these cases, wildly varying home prices (compare, for example, Manhattan's median home value with that of Rochester, New York) may explain the relatively low cost of buying a home on a statewide level.

While price plays a big part, the ability to afford a home is not the only factor that makes a state appealing to millennial homebuyers.

"You’re starting to see millennials becoming more and more mobile," says Joe Tyrell, executive vice president of corporate strategy at Ellie Mae, a real estate data company. "They’re actually moving out to areas where there is lower unemployment, relatively high population growth and more vibrancy."

At a time when quality starter homes are increasingly harder to come by, states with more available permits for new housing also attract millennial buyers, Tyrell says.

"The baby boomers, the older generation, where they’d want to move out of their home normally, we’re seeing that more of them are aging in place," Tyrell says. "It eliminates inventory that would be ripe for a first time home buyer."

How does your state stack up?