For most Americans, retiring before 50 sounds like an impossible dream. With housing, healthcare and everyday costs climbing, financial freedom might feel like a long way off. Yet Neil Jesani Wealth found there are still parts of the country where early retirement can actually work.

According to the Pew Research Center, on average, Americans say the ideal retirement age is 61.8, well past 50. With longer careers and higher costs, escaping the workforce early takes strategy, and it seems that picking the right state helps. Lower healthcare costs, manageable rents and retiree-friendly taxes can all stretch savings further than expected.

Trending Now: I Retired a Millionaire — The Best $20,000 I Ever Spent Preparing for Retirement

Check Out: 5 Clever Ways Retirees Are Earning Up To $1K Per Month From Home

To find where money lasts the longest, Neil Jesani Wealth analyzed living costs, healthcare expenses, life expectancy and tax rules and shared the results with GOBankingRates. The money needed to retire after 40 was calculated using annual healthcare costs and cost of living, and the number of years to live carefree after 40 was calculated using life expectancy and costs, to predict how long someone could enjoy retirement for without financial problems.

An overall retirement safety score was calculated out of 100, with the higher the number meaning the better chance of retiring young and finding it easy. Here are the ten best states to retire before 50 based on the results.

Money you need to retire after 40: $1,560,554

Number of years to live carefree after 40: 37.7

Quality of life index: 55.5

Retirement safety score: 99

Money you need to retire after 40: $2,334,217

Number of years to live carefree after 40: 38.5

Quality of life index: 65.6

Retirement safety score: 93

For You: The Realistic Minimum Retirement Savings Needed, According to Experts

Money you need to retire after 40: $1,708,665

Number of years to live carefree after 40: 35

Quality of life index: 55.9

Retirement safety score: 89

Money you need to retire after 40: $1,823,522

Number of years to live carefree after 40: 36.6

Quality of life index: 49.2

Retirement safety score: 87

Money you need to retire after 40: $1,750,367

Number of years to live carefree after 40: 35.1

Quality of life index: 45.2

Retirement safety score: 81

Money you need to retire after 40: $1,762,199

Number of years to live carefree after 40: 37.6

Quality of life index: 50.4

Retirement safety score: 79

Money you need to retire after 40: $1,803,200

Number of years to live carefree after 40: 35

Quality of life index: 54.3

Retirement safety score: 76