Teachers perform one of the most important jobs in the country: educating the youth so they can be functional and productive members of society.

Despite the importance of their job, teachers don’t always get the credit they deserve. Salaries for public school teachers have declined one percent from 1990 to 2013, when adjusted for inflation, according to the U.S. Department of Education. The average public school teacher earned $56,383 as of 2013.

For new teachers preparing to start their careers it is important for them to choose where to teach wisely—most teachers tend to stay put once they have a job. Of America’s 3.3 million teachers employed during the 2007-2008 school year, 84.5 percent were teaching at the same school the following year.

That begs the question: What are the best cities for teachers?

SpareFoot teamed up with Indeed, the world’s largest job site by users, to find the ten metro areas with the most job listings for teachers. Indeed also provided us with the average salary data for teachers in those markets.

We then ranked those cities by the following factors:

Job availability

Average annual salary

Median home price

Median annual rent

Finally, we combined the rankings (giving double weight to job availability) to determine an overall ranking.

Median home prices and annual rent sourced from Zillow.

10. San Francisco, CA

Teachers in San Francisco are paid quite well at $75,000 a year. That said, the city has the most expensive home and rental prices in the country—pulling it down to 10th place on our list.

Percent share of job listings (rounded): 6.8% (Ranked 9th)

Average annual salary: $75,000 (Ranked 3rd)

Median home price: $1.1 million

Salary as a percentage of home price: 7% (Ranked 10th)

Median annual rent: $52,620

Rent as a percentage of income: 70% (Ranked 10th)

9. Washington, DC

The nation’s capital ranked in either 7th or 8th place on all five of our ranking criteria.

Percent share of job listings (rounded): 7.5% (Ranked 8th)

Average annual salary: $57,000 (Ranked 8th)

Median home price: $508,250

Salary as a percentage of home price: 11% (Ranked 7th)

Median annual rent: $30,504

Rent as a percentage of income: 54% (Ranked 8th)

8. Los Angeles, CA

While the City of Angels comes in 9th on both measures of housing affordability, the high percentage of job openings for teachers gives L.A. a boost on our list.

Percent share of job listings (rounded): 10% (Ranked 4th)

Average annual salary: $59,000 (Ranked 7th)

Median home price: $570,800

Salary as a percentage of home price: 10% (Ranked 9th)

Median annual rent: $31,680

Rent as a percentage of income: 54% (Ranked 9th)

If you’re considering a move to Los Angeles, check out our Los Angeles Moving Guide.

7. Las Vegas, NV

Sin City might be a surprise to see for some, but the city is the most affordable one on our list so far. It does however have the lowest annual salary, so teachers might want save a bit before hitting the craps table.

Percent share of job listings (rounded): 7.7% (Ranked 7th)

Average annual salary: $44,000 (Ranked 10th)

Median home price: $196,100

Salary as a percentage of home price: 22% (Ranked 4th)

Median annual rent: $14,652

Rent as a percentage of income: 33% (Ranked 4th)

If you’re considering a move to Las Vegas, check out our Las Vegas Moving Guide.

6. San Jose, CA

The tech boom has created more demand for teachers in San Jose, which offers the highest average salary on our list. Finding a job is a bit harder compared to other cities on our list, with San Jose accounting for the smallest share of job listings.

Percent share of job listings (rounded): 6.4% (Ranked 10th)

Average annual salary: $78,000 (Ranked 1st)

Median home price: $733,300

Salary as a percentage of home price: 11% (Ranked 8th)

Median annual rent: $39,132

Rent as a percentage of income: 50% (Ranked 7th)

4. New York, NY (tie)

New York City has a high availability of teaching jobs, coming in second with a 15.6 percent share of total job listings on our list. The other good news is that New York is more affordable than the West Coast destinations on our list; earning it the number four spot overall.

Percent share of job listings (rounded): 15.6% (Ranked 2nd)

Average annual salary: $67,000 (Ranked 4th)

Median home price: $532,048

Salary as a percentage of home price: 13% (Ranked 6th)

Median annual rent: $27,756

Rent as a percentage of income: 41% (Ranked 6th)

4. Phoenix, AZ (tie)

Phoenix may have the second lowest salary on our list, but it is quite affordable, coming in third for both salary as a percentage of home price and rent as a percentage of salary.

Percent share of job listings (rounded): 9.4% (Ranked 4th)

Average annual salary: $46,000 (Ranked 9th)

Median home price: $197,400

Salary as a percentage of home price: 23% (Ranked 3rd)

Median annual rent: $14,352

Rent as a percentage of income: 31% (Ranked 3rd)

3. Brooklyn, NY

Wait, wasn’t New York already on this list? Turns out there were enough job listings posted on Indeed pegged specifically to Brooklyn, earning the borough its own spot on our list. Job postings for teachers in Brooklyn offered an average salary $8,000 higher than New York as a whole, which also makes housing in Brooklyn slightly more affordable overall.

Percent share of job listings (rounded): 7.7% (Ranked 6th)

Average annual salary: $75,000 (Ranked 2nd)

Median home price: $581,000

Salary as a percentage of home price: 13% (Ranked 5th)

Median annual rent: $27,240

Rent as a percentage of income: 36% (Ranked 5th)

2. Houston, TX

Bayou City is the most affordable destination for teachers on our list, coming in first place for both rental and home buying affordability. In lands in the middle when it comes to job availability and average salary.

Percent share of job listings (rounded): 8.2% (Ranked 5th)

Average annual salary: $62,000 (Ranked 6th)

Median home price: $141,300

Salary as a percentage of home price: 44% (Ranked 1st)

Median annual rent: $16,932

Rent as a percentage of income: 27% (Ranked 1st)

If you’re considering a move to Houston, check out our Houston Moving Guide.

1. Chicago, IL

Chicago had the most job availability among the top ten by a whopping margin. The Second City accounted for more than 20 percent of all available teaching jobs among the top 10 places. Combined with getting second place on both affordability rankings, Chicago was a shoe-in for first place on our list.

Percent share of job listings (rounded): 20.8% (Ranked 1st)

Average annual salary: $66,000 (Ranked 5th)

Median home price: $255,725

Salary as a percentage of home price: 26% (Ranked 2nd)

Median annual rent: $19,836

Rent as a percentage of income: 30% (Ranked 2nd)

You might also be interested in America’s 12 Best Places for Childhood Education.