If you're a first-time home buyer and looking at cities in California, you may want to rethink your plans.

Some under-the-radar metro areas in other areas of the country may provide more value.

That's according to a new study from personal finance website Bankrate, which ranked the 50 largest metro areas in the U.S. for first-time home buyers.

The cities were evaluated using criteria such as affordability, culture, job market and safety.

And the results were clear: California is one of the worst places to move to if you're looking to buy your first home.

Six out of 10 of the metro areas that landed on the bottom of the list were in the Golden State.

San Francisco, in particular, was the worst. That is because of its high home prices, market tightness and safety concerns.

More from Personal Finance:

Buying a home for the first time? Avoid these mistakes

Home buyers could save money amid rising rates

Do this and save $430 on your mortgage in the first year

"This confirms what many of us already know about that market," said Adrian Garcia, data analyst at Bankrate. "This study sheds a light on places that maybe most younger or new families aren't considering."

The city that landed on the top of the list — Pittsburgh — set itself apart with its affordability and safety.

Bankrate's data is based on existing residents, not where home buyers are moving. So you still have some time to get into these overlooked markets that landed on the top 10. Here's the list:

10. Virginia Beach, Virginia

9. Kansas City, Kansas

8. Minneapolis

7. Buffalo, New York

6. Cincinnati

5. St. Louis

4. Hartford, Connecticut

3. Oklahoma City

2. Raleigh, North Carolina

1. Pittsburgh

And for the areas you may want to avoid, these 10 cities were the worst performers.

10. Memphis

9. Miami

8. Las Vegas

7. San Diego

6. Riverside/San Bernardino, California

5. Seattle

4. San Jose, Calif.

3. Sacramento, California

2. Los Angeles

1. San Francisco

Bankrate's list was compiled from multiple data sources, including the U.S. Census Bureau, the FBI's Uniform Crime Reporting Program, the Gallup-Sharecare Wellbeing Index, the North Carolina State Bureau of Investigation, Attom Data Solutions and Realtor.com.