Whether you want to stay put or relocate when you retire, it's unlikely you'll be able to rely solely on Social Security alone to cover your expenses.

Once you factor in taxes, healthcare and housing costs, there's not much left, so the state you live in can have a big impact on your finances in retirement. But money isn't everything. You'll want to consider the quality of healthcare in the state, as well as your quality of life. Will you be able to do the activities you enjoy, stay active, volunteer, or work part-time? Will you be able to get around easily, learn new things, or make new friends as you age?

To determine the best states to retire, personal finance site WalletHub compared all 50 states across 46 key indicators of retirement-friendliness, focusing on affordability, health-related factors and overall quality of life.

The affordability category includes factors such as tax-friendliness, cost of living, cost of in-home healthcare and the share of the population over 65 who could not afford a doctor visit. In quality of life, they included the share of the population over 65, risk of social isolation, elderly-friendly labor market, access to public transportation, weather and several other factors. Health care includes things such as the number of doctors, dentists and nurses per capita, the quality of hospitals, well-being index, and many others.

So if you're thinking of moving closer to the kids in Illinois or buying a condo near the beach in Florida, take a look at which states are the best for retirees: