SAN DIEGO (CNS) - San Diego is the fourth-best large city in the country in which to live, according to a ranked list released Tuesday by the personal finance website WalletHub.

WalletHub ranked cities with a population above 300,000 by evaluating their affordability, economic strength, education and health quality, quality of life and safety. A total of 62 cities were sampled for the list, with Virginia Beach, Virginia, taking the top spot.

San Diego ranked 51st in affordability but ranked among the top-10 cities in education and health, quality of life and safety, and 12th in economic strength. According to WalletHub data, San Diego had the second-lowest crime rate behind Virginia Beach and was tied for first for coffee shops per capita.

Joining San Diego and Virginia Beach among the top five were Austin, Seattle and Las Vegas in second, third and fifth, respectively. Rounding out the top 10 were San Francisco, New York, San Jose, Honolulu and Portland, Oregon.

Detroit, Michigan, ranked last among large cities due to its dead-last ranks for economic strength and health and education quality. Memphis, Cleveland, Baltimore and St. Louis also sat in the bottom five. All five cities at the bottom of the list were in the bottom half for public safety, economic integrity and health and education quality.

San Diego ranked fifth on last year's list and fourth on WalletHub's 2017 big cities list.