My iPhone 5 keeps turning off randomly?

I have an iPhone 5 as it says, but I've been having some trouble with it recently, it keeps turning off randomly, when it has at least 40% battery, and it won't turn back on if I hold down the sleep button, it sometimes but only rarely turns back on when I hold down the sleep button and the home button for ten seconds, but 90% of the time I have to plug it into the charger or wait about half an hour for it to turn back on, has anyone else had this problem? It just started randomly, I haven't dropped it or gotten it wet or anything, I only got it in January, thank you In advance.

Probably just a glitch from apple, try taking it to an apple store or call apple about it

Not much I can say other than you should have gotten a galaxy s4…

Happens to me too. No cure yet

Yeah this is the exact problem that im having with my iphone right now i asked help on their technical support on their website and suggested to update my o.s. Since mine is outdated, i just updated to the latest os. Hopefully if fixes the problem if dont i gotta bring it to apple

Same problem. When you take it to an apple store they tell you to wipe all your data!

Have had this problem several times during the past year - apparently it's a glitch with the 5. Happened today with it showed 83% charge. First time it's happened when I had more then 50% charge. Not upgraded to IOS 7 - did not see anything in the materials about it addressing this problem.

I have been having the same problem. Talked to both Verizon Wireless and Apple, they tested the battery and Apple had me back it up to ICloud and then restore it as a new phone, but it is still happening. Very frustrating and neither place will even talk about replacing it for me because I didn't spend a wad of extra money for insurance!

The same thing happens but some days it doesn't happen and then randomly when I'm on 30+%. However I have always thought it was because I have many apps running on my phone ie. Facebook, twitter, snapchat, instagram. It doesn't help when snapchat basically kills the battery which needs to be fixed.

I am having this problem too it is very annoying

Having the same problem. Plugging it in won't turn it back on. It's been happening more and more frequently. I have insurance but I think this just made up my mind to switch to a Galaxy.

all this is not helping we all have this problem but no reply from apple as how to fix this does anyone really know what to do?