A Northern California city was named the happiest in America and joined six other cities in the Golden State to make the top 20 in a new study from WalletHub.

“Fremont, CA is the happiest city in America, and one contributing factor is that the city has the highest share of households with an income above $75,000, at nearly 80%,” WalletHub analyst Cassandra Happe said.

However, money can only make you so happy. Consider also the fact that while the U.S. is one of the richest countries, it ranks only 15th on the World Happiness Report.

“In addition, Fremont has the lowest separation and divorce rate in the country and the lowest share of adults who report having 14 or more mentally unhealthy days in the past month,” Happe said.

Location also plays a hand in how bright or gloomy our days are. For years, researchers have studied the science of happiness and found that its key ingredients include a positive mental state, a healthy body, strong social connections, job satisfaction and financial well-being.

WalletHub drew upon the various findings of positive-psychology research in order to determine which among more than 180 of the largest U.S. cities is home to the happiest people in America.

They examined each city based on 29 key indicators of happiness, ranging from the depression rate to the income-growth rate to the average leisure time spent per day.

Here’s a list of WalletHub’s 20 happiest cities in America:

  1. Fremont, CA
  2. Overland Park, KS
  3. San Jose, CA
  4. Madison, WI
  5. Irvine, CA
  6. Honolulu, HI
  7. San Francisco, CA
  8. Pearl City, HI
  9. Columbia, MD
  10. Scottsdale, AZ
  11. Sioux Falls, SD
  12. Huntington Beach, CA
  13. Minneapolis, MN
  14. Garden Grove, CA
  15. San Diego, CA
  16. Fargo, ND
  17. Portland, ME
  18. Seattle, WA
  19. Lincoln, NE
  20. Bismarck, ND 

Check out the full list with detailed ranking information on WalletHub.com.

To see which states combine all the necessary components of happiness, check out WalletHub’s report on the Happiest States in America.