Technology advances very fast, and one of which, is the inside of the mobile devices we use.
While their hardware and software are becoming more capable and more powerful, the source of energy that powers them doesn't advance as fast. It does improve with research and time, but considering our use of mobile devices increase, the pace batteries is advancing cannot keep up with our habits.
Typically, a modern smartphone battery’s (Lithium-ion) has a lifespan of 2-3 years.
That translates to about 300-500 charge cycles as rated by manufacturers. After that, the battery capacity will drop by roughly 20%, leaving the battery with an effective 80% of its normal capacity when it was new.
Depending on how you use your smartphone, its battery may last longer, or shorter.
Putting aside your activities while using your phone, the way you charge your phone matters. The reason is the chemicals inside the batteries.
The Chemicals That Do The Magic

Before detailing how Lithium-ion batteries work, Nickel-based batteries, the predecessor, need to be drained completely, to then be recharged to a 100%.
These batteries can lose capacity if they are repeatedly recharged only after being partially drained.
What this mean, frequent charging will degrade Nickel-based batteries quickly. This happens because Nickel-based batteries are cursed with memory effect, meaning that the batteries can simply "forget" their full capacity if they aren’t discharged and charged from 1% to 100%.
Lithium-ion batteries use different chemicals, making them work quite the opposite.
A Lithium-ion battery or Li-ion battery is a type of rechargeable battery, commonly found on modern mobile devices and other portable electronics, electric vehicles, as well as those in the military and aerospace industry.
Many satellites are also powered by Li-ion.
The technology can be dated back to the 1970s, before first commercialized by Sony and Asahi Kasei team led by Yoshio Nishi in 1991.
In the batteries, the chemical lithium ions move from the negative electrode through an electrolyte towards the positive electrode during discharge, and the other way around when charging. Lithium-ion batteries use an intercalated lithium compound as the material at the positive electrode and usually graphite at the negative electrode.
Lithium-ion batteries have a much higher energy density, and no memory effect (other than LFP cells), and low self-discharge. These properties give them the advantages over their Nickel-based counterparts.
On smartphones and other mobile devices, Lithium-ion batteries have a flat or pouch appearance with a soft, flat body. Inside it, there are cells with a cylindrical shape, made in a characteristic "swiss roll" manner (or also known as "jelly roll").
This means that the batteries have a single long 'sandwich' of positive electrode, a separator, negative electrode, and separator rolled into a single spool.
It's the electrodes that hold the charges.

The Chemistry At Work, And The Problem That Happens
The reactants in the electrochemical reactions in a Lithium-ion cell are the anode and cathode, both of which are compounds containing lithium atoms. During discharge an oxidation reaction at the anode produces positively charged lithium ions and negatively charged electrons, as well as uncharged material that remains at the anode.
The electrolyte and external circuit are the ones providing the conductive media.
In theory, Lithium-ion batteries with its components that work under closed containers and away from external elements should last forever.
But in fact, it's the reactions during discharge that lower the chemical potential of the cell, most notably, the cathode, which results in reduced capacity.
The lithium count also gradually drops as more and more get lodged and trapped onto the anode during normal usage; as they form a restrictive layer called solid electrolyte interface. This barrier increases the battery’s internal resistance, and also ultimately lowers the battery capacity.

In other words, it's the chemistry problem inside Lithium-ion batteries that makes degrades them.
Knowing this fact, it's clear that extreme lows and extreme highs can quickly take chunks off the battery's life away.
To make a Lithium-ion battery lasts longer, the rules is to prevent:
- High discharge rate (how fast the battery is consumed).
- Deeper discharge (depth of discharge, or how much the battery is used before charging).
- Low battery level (as is high battery level, but with different structural change).
- Extreme temperatures, both low and high.
The easiest way to prolong Lithium-ion batteries, is to avoid all of the points above.
While it's common to say and see that Lithium-ion smartphones have shorter and shorter lives if used frequently, phones with 0% battery will also lose capacity in what is called a "deep discharge'. At this occasion, the battery battery's protection circuit intended to prevent power from reaching defective battery cells is triggered.
This leaves the battery unable to charge at all.
So here, the best bet to prolong Lithium-ion batteries, is to use what the community calls the '40-80 rule'.
The rule is to keep your battery life somewhere between 40% and 80% at all time. This should prevent the above stated "stresses", which in turn should keep the batteries last longer.
The reason is because the deeper you discharge it, the more stress you are inflicting the battery. Topping it up to full capacity every time, can also induce stress. What this means, charging up frequently should extends battery life for Lithium-based batteries.
In this regard, doing a full discharge, which is to run your battery down to 0%, is the most stressful.
Full charging also does the same. As the level closes to 100% the stresses increase.

What's more, every time you recharge the battery from 0% to 100%, that’s one cycle. By recharging your device from 40% to only 80% instead, you’re actually tripling or quadrupling the number of recharges the battery can undergo
And if you want to keep your Lithium-ion-powered smartphone in the drawer for a long time, besides leaving it half charged, if possible, you may as well remove the battery and always keep it cool. Even when just sitting on a shelf, irreversible internal structure still happen. But by keeping it charged somewhere at 50%, it will negate some of the stresses the battery should endure.
50% charged is the level considered the safest for battery life, and also the reason why companies like Apple suggest people to store batteries at half-charged.
Similar to a mechanical device that wears out faster with heavy use, the depth of discharge (DoD) determines the cycle count of the battery. The smaller the discharge (low DoD), the longer the battery should last.

Lithium-ion also suffers from stresses when exposed to heat.
There are many sources of heat when using smartphones. From the temperature the phone is at, the processors that generate a lot of heat, and also from the plugged charger. A battery at temperature above 30°C is considered elevated temperature, and for most Li-ion a voltage above 4.10V/cell is deemed as high voltage.
Exposing the battery to high temperature for an extended time can be more stressful than cycling.

The Exception To The Rule
Practicing the 40-80 rules can prolong your smartphone's battery life. It's not the easiest way in terms of daily use, but it's the best belief to keep it last longer.
Lithium-ion batteries are made and designed to withstand quick and short charges. Because there is no memory, the battery does not need periodic full discharge cycles to prolong life.
However, there are some exceptions to the 40-80 rule.
For example, if your phone's battery percentage drops suddenly, your phone dies all in a sudden, just because it says that it has no power left. To counter the issues, you should calibrate the battery.
To do this, keep your phone off and plug it to charge the battery until 100%. Power the phone on, and see whether it shows 100%. If not, charge it again until it reaches that number before unplugging. After that, let the phone discharge by itself until 0%, and then recharge it back to 100%.
This can happen because unlike the actual electrochemical inside the battery, the chip on the battery that shows you the reading doesn’t age as fast.
Bottom Line
You should also know that Lithium-ion and other kind of batteries for that matter, will degrade regardless of what you do or not do.
But it's the practice of taking care of your batteries that will make them last longer.
As long as you understand what’s harmful to your battery, you can tailor your charging habit according to your needs and daily routine. Again, it may be a burden to power users, knowing that the 40-80 rule demands sacrificing your enjoyment and convenience, which is what your smartphone is supposed to bring you.
Newer technology on smartphones introduce software capable of maintaining batteries better. For example, trickle charging to prevent overcharging, auto-calibration, power saving at the OS level or even at the hardware level.
But still, batteries are batteries. They have compounds inside them that will age. No products can last forever at their prime. It's natural, and batteries are no exception.
Each and every time you plug in your electronic, whether it be a smartphone or a laptop, it will actually hold a little less energy than it did the time before. And the 40-80 method should increase the lifespan, although a little.
So if you care about the longevity of your Lithium-based batteries, you can definitely lift a bit of their burdens if you want to.
Related: Extending The Life Of Your Gadget's Battery, Prolonging Its Usage