When it comes to retirement, California is right in the middle of the pack.

A new BankRate.com study finds that the Golden State ranks 28th in the best states for retirement. We got high marks for our fantastic weather as well as for residents' happiness.

However, Bankrate.com analyst Chris Kahn says the state was brought down by a high cost of living and taxes.

"Imagine someone who is on a fixed income moving into California. Some of the biggest issues they are going to have to deal with are housing, gas prices, grocery prices -- everything is much higher than the national average when you're talking about the cost of living in California," Kahn said. 

South Dakota, Colorado and Utah are the top states for retirees according to the study.

New York was found to be the worst state to retire while West Virginia and Alaska round out the bottom three.

Check out the complete study, here.