Wikipedia Commons

A recent study by WalletHub rated the 150 largest U.S. cities on a scale of best to worst for retirement, based on affordability, job prospects, activities, quality of life and health care.

Affordability was measured by the cost of living, taxes and in-home care costs. Activities looked at whether there were senior centers and outdoor sports. Quality of life included everything from weather to crime rate. Health care was based on price and availability. And finally, job prospects were weighted less heavily (since the goal is not to work).

Here, we've compiled the top 30 cities on WalletHub's ranking, with Salt Lake City coming in at No. 19. The list begins with No. 30 and works up to No. 1.

30 Denver, Colorado
Wikimedia Commons

Affordability: 82

Jobs: 60

Activities: 11

Quality of Life: 89

Health Care Rank: 54

29 Austin, Texas
Wikimedia Commons

Affordability: 24

Jobs: 35

Activities: 49

Quality of Life: 118

Health Care Rank: 57

28 Augusta, Georgia
Wikimedia Commons

Affordability: 12

Jobs: 74

Activities: 122

Quality of Life: 26

Health Care Rank: 90

27 Lubbock, Texas
Wikimedia Commons

Affordability: 3

Jobs: 12

Activities: 125

Quality of Life: 108

Health Care Rank: 64

26 Gilbert Town, Arizona
Wikimedia Commons

Affordability: 89

Jobs: 21

Activities: 114

Quality of Life: 21

Health Care Rank: 23

25 Lincoln, Nebraska
Wikimedia Commons

Affordability: 42

Jobs: 3

Activities: 58

Quality of Life: 56

Health Care Rank: 108

24 Tucson, Arizona
Wikimedia Commons

Affordability: 58

Jobs: 92

Activities: 34

Quality of Life: 14

Health Care Rank: 105

23 Brownsville, Texas
Wikimedia Commons

Affordability: 2

Jobs: 129

Activities: 140

Quality of Life: 62

Health Care Rank: 54

22 Vancouver, Washington
Wikimedia Commons

Affordability: 103

Jobs: 72

Activities: 16

Quality of Life: 61

Health Care Rank: 11

21 Mesa, Arizona
Wikimedia Commons

Affordability: 89

Jobs: 86

Activities: 60

Quality of Life: 15

Health Care Rank: 44

20 Boise City, Idaho
Wikimedia Commons

Affordability: 33

Jobs: 32

Activities: 52

Quality of Life: 11

Health Care Rank: 140

19 Salt Lake City, Utah
Ray Boren, Deseret News

Affordability: 61

Jobs: 14

Activities: 4

Quality of Life: 139

Health Care Rank: 43

18 Tempe, Arizona
Wikimedia Commons

Affordability: 89

Jobs: 21

Activities: 44

Quality of Life: 69

Health Care Rank: 15

17 Cincinnati, Ohio
Wikimedia Commons

Affordability: 60

Jobs: 21

Activities: 1

Quality of Life: 120

Health Care Rank: 70

16 Fort Lauderdale, Florida
Wikimedia Commons

Affordability: 57

Jobs: 50

Activities: 18

Quality of Life: 97

Health Care Rank: 24

15 Aurora, Colorado
Wikimedia Commons

Affordability: 82

Jobs: 9

Activities: 41

Quality of Life: 81

Health Care Rank: 11

14 Garland, Texas
Wikimedia Commons

Affordability: 26

Jobs: 92

Activities: 107

Quality of Life: 45

Health Care Rank: 4

13 Pembroke Pines, Florida
Wikimedia Commons

Affordability: 55

Jobs: 117

Activities: 115

Quality of Life: 6

Health Care Rank: 20

12 Irving, Texas
Wikimedia Commons

Affordability: 26

Jobs: 40

Activities: 59

Quality of Life: 97

Health Care Rank: 3

11 Colorado Springs, Colorado
Wikimedia Commons

Affordability: 35

Jobs: 12

Activities: 25

Quality of Life: 49

Health Care Rank: 67

10 Peoria, Arizona
Wikimedia Commons

Affordability: 89

Jobs: 67

Activities: 43

Quality of Life: 5

Health Care Rank: 10

9 Plano, Texas
Wikimedia Commons

Affordability: 40

Jobs: 54

Activities: 109

Quality of Life: 29

Health Care Rank: 1

8 Cape Coral, Florida
Wikimedia Commons

Affordability: 54

Jobs: 86

Activities: 84

Quality of Life: 4

Health Care Rank: 38

7 Port St. Lucie, Florida
Wikimedia Commons

Affordability: 5

Jobs: 62

Activities: 56

Quality of Life: 17

Health Care Rank: 51

6 Overland Park, Kansas
Wikimedia Commons

Affordability: 77

Jobs: 5

Activities: 91

Quality of Life: 10

Health Care: 8

5 Scottsdale, Arizona
Wikimedia Commons

Affordability: 100

Jobs: 54

Activities: 14

Quality of Life: 3

Health Care: 21

4 St. Petersburg, Florida
Wikimedia Commons

Affordability: 9

Jobs: 45

Activities: 31

Quality of Life: 48

Health Care: 49

3 Orlando, Florida
Wikimedia Commons

Affordability: 7

Jobs: 98

Activities: 2

Quality of Life: 93

Health Care: 30

2 Grand Prairie, Texas
Wikimedia Commons

Affordability: 26

Jobs: 58

Activities: 70

Quality of Life: 30

Health Care: 2

1 Tampa, Florida
Wikimedia Commons

Affordability: 9

Jobs: 92

Activities: 3

Quality of Life: 19

Health Care: 46