Both states did very well in the study, based on factors such as cost of living and crime rate.

A new study by bankrate.com ranked all 50 states to determine the best places in the country to retire.

Maine ranked 11th, and New Hampshire ranked 15th.

New Hampshire ranked 1st in health care quality, and 7th in crime rate and tax rate.

Maine ranked 3rd in health care quality and crime rate.

The number one state overall for retirement was Wyoming. Coming in last - New York.

See the full study here