Why is my iphone 5 keep shutting off randomly when it still has battery?

My iphone 5 had 8 percent left don't remember if it was charging from my laptop but I check it was 8 percent before I went to bed. I woke up at 4am and it was dead. I let it be and decided to charge it the next day. Then in the morning when I connect my iphone to the car it charged to 97%. What could possibly happen? Please help thank you!

I'm thinking maybe my laptop died and probably messed up my iphone but either way why would it suddenly charge to 97% the next day?

This happens to me too! I was at 38% and it died

  • Why is my iPhone 5c shutting off at 30-40%? I got an iphone 5 c like 2 months ago and so far its the worst phone i have ever gotten the adhesive doesn't stay on ( poorly made phone) and it falls apart all the time… I have never dropped it… It also shuts off at 30-40% percent and says i have no battery left… Please help thanks
  • Why is my iPhone 4 shutting down with 20% battery left? For the past week, my phone's been shutting off when it gets to 20% battery life. I don't know why, as I make sure background apps are shut off… Anyone know any solutions to stop this happening?
  • Why does my iPhone 5c keep on shutting off? So I've had my iPhone 5c for a while now and it's been acting up lately. I haven't used it for a while because it just keeps on randomly turning off and I don't know why. Do you guys have any suggestions? By the way I've already changed the battery on my phone and my charger is fine just have like two. I'm starting think it's my screen because i once tried to turn it on and than it started to glitch /
  • My Iphone keeps shutting off, but before it shuts off, my screen freezes and there's these lines that show up, they're random? My Iphone keeps shutting off, but before it shuts off, my screen freezes and there's these lines that show up, they're random. Sometimes there's this crackling sound, and sometimes the line move, my mom says its just the phone, but my dad says, its the proccecor and that its overheated, i have an Iphone SE rose gold 64 gb and my iOS is 12.3.1