(NEXSTAR) – Happiness doesn’t grow on trees, but it may be a little easier to come by in California, a new study has found.

Reviewing federal and local government data across 13 metrics based on personal finances, well-being, and quality of life, SmartAsset ranked nearly 165 of the nation’s largest cities to find where Americans are happiest. 

California dominated the list with 17 cities among the top 50 – six landed in the top 10. Most are in either the Bay Area and around Los Angeles, as you can see in the map below.

Overall, Sunnyvale was found to be the happiest city in the U.S. Located just north of Cupertino outside San Jose, Sunnyvale had the highest quality of life score of any city analyzed. According to SmartAsset, Sunnyvale had the highest percentage of individuals earning $100,000 or more; the third-lowest percentage of adults living in poverty; and one of the highest marriage rates.

Another California city, San Francisco, ranked highest for well-being, which was calculated based on the percent of the population reporting poor mental health days, life expectancy, physical activity rate, and percent of adults with health insurance. 

Below are all 17 California cities that ranked among the happiest places in America, as well as how they ranked overall:

Sunnyvale (1)Fremont (4)
Roseville (7)San Jose (8)
Santa Clarita (9)Irvine (10)
Huntington Beach (11)San Francisco (14)
Hayward (17)Glendale (21)
Santa Rosa (25)Fullerton (27)
San Diego (31)Oakland (32)
Corona (44)Chula Vista (45)
Sacramento (50)

SmartAsset found California cities widely had among the best scores across the metrics it reviewed. San Francisco had the highest well-being score, Sunnyvale had the highest quality-of-life score, and Irvine had the lowest violent crime rate across all cities.

Not every California city ranked highly across the board, though. Five cities ranked in the bottom 10 in the personal finance category. Based on the percentage of individuals earning $100,000 or more, cost of living as a percent of income, personal bankruptcy filings, and down payment-to-income ratio, Chula Vista had the lowest score among the top 50 cities. Other low-ranking cities in this category include Corona, Glendale, San Diego, and Hayward.

Corona also ranked among the lowest in the well-being category, and Oakland and Sacramento landed in the bottom 10 for quality of life.

Cities in Virginia, Washington, and Texas were among the top 10 happiest U.S. cities, SmartAsset determined. Here’s where Americans are happiest:

  1. Sunnyvale
  2. Arlington, Virginia
  3. Bellevue, Washington
  4. Fremont
  5. Frisco, Texas
  6. Plano, Texas
  7. Roseville
  8. San Jose
  9. Santa Clarita
  10. Irvine

Birmingham, Alabama was the least happy place based on the metrics reviewed in the study. It scored poorly in multiple metrics, including personal bankruptcy filings per capita, life expectancy, and the percentage of residents living in poverty. 

SmartAsset’s complete study can be found here.