Young people say these are the 2 main reasons they can't buy homes

The income you need to afford a home in the biggest U.S. cities

When it comes to , , including , and , can stand in the way. But for young people in particular, there are two main problems: and expensive down payments.

That's according to real estate website PropertyShark, which surveyed more than 2,100 U.S. renters, owners and people living with family, "to better understand the difference in attitude" toward homeownership between millennials and those in Generation Z and Generation X.

Over a third, or 35 percent, of millennials say "" is their biggest obstacle to buying a home. That could be because millennials have saved an average of $24,820 and median savings of only $2,430, according to an analysis by MagnifyMoney. Almost 20 percent cite "student debt," 16 percent say "," 13 percent say "increasing home prices," 10 percent say "economic factors," and 9 percent say "job insecurity." 

For those in Gen Z, the No. 1 obstacle is student debt and the No. 2 obstacle is the down payment. And for frustrated would-be homeowners from Gen X, 31 percent say the down payment is to blame, while 21 percent point to credit scores.

PropertyShark: Biggest obstacles to buying a home

All three generations agree that the down payment is one of the most significant obstacles, which makes sense. The average down payment on a home is 20 percent, reports financial site SmartAsset. With a national median home price just under $280,000, a typical down payment would be a whopping $56,000.

The burden of student loans, which weighs especially heavily on younger generations, doesn't help, either. to pay for school, and their debt surpasses $1.4 trillion. The for 20-year-olds is $22,135 and for 30-year-olds, it's $34,033.

"Millennials may be the largest category of homebuyers right now, but half of the Americans born between 1980 and 1995 ," says PropertyShark, and that's "just as many as their younger Gen Z peers."

Because of loans and high down payments, many young people "who aspire to own their own place have been locked into the rental market far longer than previous generations," the report explains. "This, in turn, has been pushing rental rates to the highest they've ever been — a boon for multifamily investors, but that rent burden coupled with college debt continues to keep many from saving enough for a down payment."

Real estate mogul: Here's a trick first-time homeowners could use to live for free

Still, Americans remain optimistic about buying homes. "More than 80 percent of respondents from all three generations expect to buy a home in the next five years," says PropertyShark, including 87 percent of millennials and 83 percent of those in Gen Z.

To gauge respondents' attitudes on housing, the researchers asked individual questions about savings, homeownership, amenity and community preferences, as well as demographic data, including employment and marital status.

Millennials were defined as those born between 1981 and 1994,  Gen Z was defined as being born between 1995 and 1999, and Gen X was defined as those born before 1980.

If you're looking to buy a home, be sure you're ready to . And if you're looking to rent, check out these , and .

Like this story? Subscribe to CNBC Make It on YouTube!

Don't miss: This 30-year-old commutes 4 hours, and 140 miles, every day so he doesn't have to pay $4,500-a-month San Francisco rent

Video by Mary Stevens and Andrea Kramar

Millennials are making a big mistake by not owning their homes, says one financial expert