Getty Images

Everyone wants to live well, but that often comes down to what city you live in. In fact, the best places to live are likely the ones where you can find a job, earn a good salary and buy a nice home. The labor market research firm Glassdoor calculated the spots where your pay will go furthest, based on salaries and home values. To do so, it came up with a cost of living ratio — a city's median base salary divided by its median home value. "Though there are certainly other financial factors to consider when taking into account the total cost of living, this data reinforces that pay typically goes further in mid-sized cities versus big metropolitan areas where there is often tighter competition for housing," said Andrew Chamberlain, Glassdoor's chief economist. While you can earn more in cities like New York and San Francisco, many people can't afford to buy a house or an apartment there. So here are the top places where an average paycheck goes a very long way and the quality of life is great. Think lakefront homes, bike trails to work and live music. — By CNBC's Jessica Dickler

Posted 12 Sept. 2016

5. Indianapolis

Downtown Indianapolis Education Images | UIG | Getty Images

Cost of living ratio: 43% Median base salary: $56,000 Median home value: $130,200 Number of open jobs: 33,090 With employers like Eli Lily and Anthem health insurance, this mid-sized city has a healthy job market. It has dedicated stretches of urban trails and bike lanes for commuting to work, not to mention a vibrant happy-hour scene over a five-block stretch of what's known as Mass Ave. Clearly residents here work hard and play hard, particularly when it comes to motor sports. "We're huge race-car fans," said Morgan Snyder, director of leisure communications at Visit Indy. "The Indy 500 is our Disneyland."

4. Cleveland

Cleveland, Ohio Jerome Phenney | Getty Images

Cost of living ratio: 44% Median base salary: $55,000 Median home value: $125,500 Number of open jobs: 29,304

This Midwestern city rose to prominence in the steel age, and wealthy patrons left behind historic mansions, cultural institutions, including the (free) Cleveland Museum of Art, parks and one of the world's top orchestras. As manufacturing waned, the health-care industry has revitalized the job market, thanks to the Cleveland Clinic and other employers. Still, "the bang for your buck is unbelievable," said Jeff Kipp, director of neighborhood marketing at Cleveland Neighborhood Progress. "You can find a very nice turnkey home for $100,000 and fixer-uppers for $50,000 or a lakefront property or old mansion on Euclid Avenue for $500,000," he said.

3. Pittsburgh

Pittsburgh, Pennsylvania Walter Bibikow | Getty Images

Cost of living ratio: 45% Median base salary: $56,896 Median home value: $126,700 Number of open jobs: 46,379 This former steel town is also experiencing a renaissance — just ask Google and Uber, which recently opened offices there. Part of the allure is skilled workers from Carnegie Mellon and the University of Pittsburgh. "There are a lot of jobs so graduates are staying," said Craig Davis, president and CEO of VisitPittsburgh. It doesn't hurt that there's also a slew of affordable loft spaces and condos converted from older buildings right downtown, in addition to a burgeoning restaurant scene — making Pittsburgh the No. 1 foodie city for 2016, according to Zagat.

2. Memphis

Memphis, Tennessee Getty Images

Cost of living ratio: 46% Median base salary: $52,000 Median home value: $112,100 Number of open jobs: 17,982 Most famous for its music roots, Memphis is now gaining a reputation for its favorable cost of living. The city attracts plenty of talented job seekers, especially to the emerging health-care industry. "The median home price is really, really low," said Jessica Jaffe, Glassdoor's community expert. "Particularly for physicians, doctors and those in health care making an average salary — that goes a really long way." And there are still plenty of free concerts and live bands playing on Beale Street for the music lovers.

1. Detroit

Traffic in downtown Detroit Getty Images