If you want to become a homeowner, you don't need to earn six figures. But you may need to live in the right place.

Using the National Association of Realtors' Metropolitan Median Area Prices and Affordability and Housing Affordability index from the second quarter of 2018, CNBC Make It identified 15 cities where the qualifying income to purchase a home with a 10 or 20 percent down payment is an annual salary of $40,000 or less.

The data assumes a 4.7 percent mortgage rate for all areas and a monthly principal and interest payment limited to 25 percent of a resident's income.

While buyers may still need to pay down debt, save up cash and qualify for a mortgage, the bottom line is that buying a home on a middle-class salary is still possible — in some places.

Below, check out 15 cities where you can become a homeowner while earning $40,000 a year or less.