Lithium-ion batteries, like those in iPhones, have a longer usable life if you don’t charge above 80%. But, to last the day, you probably want a full charge. With iOS 13, Apple may give you the best of both worlds.

iOS 13 Will Charge to 80% and Wait

Apple announced iOS 13 at WWDC 2019. Buried in the list of extra features was a note about “battery optimization.” Apple says it will be “reducing the time your iPhone spends fully charged.” Specifically, Apple will prevent your iPhone from charging above 80% until you need it.

You might be wondering why Apple wants to keep your iPhone at 80% charge. It’s all about the way Lithium-ion battery technology works.

Lithium-ion Batteries Are Complicated

Batteries, in general, are complicated technology. The fundamental goal is to cram as much energy as possible into a small a space as possible, then safely release that energy without causing a fire or explosion. It’s a juggling act of priorities.

Lithium-ion batteries make things extra complicated by being rechargeable. Earlier rechargeable technology suffered from the memory effect—essentially, batteries lost track of their maximum capacities if you constantly recharged them after only partially discharging them. Lithium-ion batteries don’t have that problem. If you’re still draining your battery to empty before recharging it, you should stop. You’re damaging your battery’s health.

RELATED: Debunking Battery Life Myths for Mobile Phones, Tablets, and Laptops

You Shouldn’t Keep Your Battery at 100%

Lithium-ion batteries charge to 80% faster than previous battery technologies did. For most people, 80% is enough to make it through the rest of the day, so it gives you what you need sooner. It also doesn’t have the dreaded “memory effect” that causes the battery to lose track of its full capacity.

However, instead of having a memory issue, Li-ion has a maximum charge cycle issue. You can only recharge the battery so many times, and then it starts to lose capacity. It’s not merely charging zero to 100% that counts as a full charge. If you charge from 80 to 100% five days in a row, those 20% charges add up to one “full charge cycle.”

Not only does draining the battery to zero and then charging to 100% hurt your battery in the long run, always charging the battery isn’t good for it either. By staying near 100%, you risk overheating the battery (which can cause damage). Additionally, to prevent your battery from “overcharging,” it stops the charge for a while, then starts again.

That means if you charge your device overnight after it hits 100%, it drops to 98 or 95%, then charges back up to 100%, and repeats the cycle. You’re using your maximum charge cycles without even actively using the phone.

The Solution: The 40-80 Rule

For all these reasons and more, most battery manufacturers will recommend the “40-80 rule” for lithium-ion. The rule is straight forward: try not to let your phone deplete too much (less than 40%), which can damage the battery, and try not to keep your phone charged entirely (more than 80%) all the time.

Either scenario is made worse by weather, so if you want your battery to retain its full capacity longer, keep it around 80%.

iOS 13 Sits at 80% During the Night

Recent iOS updates include a battery health feature the let you check on your battery capacity, and see a history of your battery usage. The feature is a useful way to know if you’ve stuck to the 40-80 rule.

But Apple knows you don’t want to start the day around 80%. If you travel a lot or otherwise find yourself frequently out of reach from an outlet, that extra 20% can easily be the difference in whether your iPhone makes it to the end of the day. Staying at 80% risks losing a valuable asset, your phone. That’s why the company wants to meet you in the middle.

In iOS 13, a new charging algorithm will keep your iPhone at 80% when charging overnight. That algorithm will determine when you typically wake up and start the day, and restart the charging sequence to give you fully charged battery when you wake up.

That means your iPhone won’t spend the entire night taking a charge it doesn’t need (and risk overheating), but when you start your day, you should have 100% battery charge. It’s the best of both worlds to give you as long as battery life as possible, both in retaining the full capacity of the battery and making it through the day.

RELATED: How to Check Your iPhone's Battery Health