Real estate mogul Barbara Corcoran: Use this simple formula to figure out how much to spend on your first home

Here's exactly how much house you can afford on your salary, according to Barbara Corcoran

Self-made millionaire and "Shark Tank" star Barbara Corcoran wants young people to buy homes.

"The faster you buy your first home, in my opinion, the better," she tells CNBC Make It. "You've got to get in the game." Other experts agree, including self-made millionaire David Bach, who says that not prioritizing homeownership is the single biggest money mistake millennials are making.

Buying a home may be the biggest purchase you ever make, and you want to be sure the one you choose is one you can afford.

Corcoran, who made her fortune in real estate, offers a simple formula to help you figure out just how much you should spend on your first home: "Multiply your salary times four and that's generally what you can qualify for." This formula assumes you're making a 20 percent down payment, she adds.

Barbara Corcoran speaks on stage at NAPW 2014 Conference
Brian Ach | Getty Images Entertainment | Getty Images

Based on Corcoran's equation, here's roughly how much home you can afford if your salary is:

$30,000 a year: $120,000
$40,000 a year: $160,000
$50,000 a year: $200,000
$60,000 a year: $240,000
$70,000 a year: $280,000
$80,000 a year: $320,000
$90,000 a year: $360,000
$100,000 a year: $400,000

While, ideally, you'll be able to make a 20 percent down payment, "if you haven't been able to muster 20 percent together, you shouldn't lose heart," Corcoran tells Make It. Some experts, like Bach, say a down payment of at least 10 percent is OK, though more is always better.

You can also look into Federal Housing Administration (FHA) loans, she says, which only require you to put down 3.5 percent. They do require mortgage insurance, though, she notes: "The problem with the FHA loan is your closing costs are going to be slightly higher: You generally have 3.5 percent in closing costs ... but with a FHA loan, you're going to be forced to buy additional insurance, which can amount to as much as 2 percent."

Another simple rule of thumb to follow, says Corcoran, is to aim to spend about 30 percent of your take home pay on housing costs. Keep in mind that this 30 percent encompasses more than just the sticker price of the home: It should include all homeownership costs, likes mortgage interest, taxes, insurance, maintenance and any renovations you might want to make.

At the end of the day, "the sooner you get into the real estate business for yourself, the better," so do whatever you can to get in the game, as Corcoran puts it. That might mean starting small, she says: "If you're thinking about buying your first one-bedroom, change your thinking — buy your first studio instead. If you can't afford a good studio, buy a little studio, the reason being is you want to trade up.

"Every single person who is living in a multimillion-dollar home started with something smaller that they didn't find acceptable. Lower your standards. Get something small so you have a chit in the game, and you can trade up the studio to a one-bedroom, two-bedroom, four-bedroom house."

Disclosure: CNBC owns the exclusive off-network cable rights to "Shark Tank."

Don't miss: Here's why Warren Buffett thinks you should buy a home

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

The biggest mistake millennials are making is not buying a home, says financial expert