An iPhone X charging wirelessly. Hollis Johnson/Business Insider

Do you know how to keep your smartphone's battery healthy?

Probably not. In fact, you may have been hastening the death of your phone's battery with your charging habits.

Charging to 100%, or overnight? Fully discharging before plugging in? These common practices can shorten the usable life of your battery, according to Cadex, a company that offers devices that test smartphone batteries, among others.

How to best extend the life of batteries has been a prime topic since Apple disclosed last month that it was slowing down iPhones with degraded batteries to prevent the devices from shutting down unexpectedly.

Cadex offers a lot of information on its Battery University website, including about lithium-ion batteries — the type that powers smartphones.

It turns out that if you want to delay having to replace your battery or buy a new phone, there are specific percentage levels within which you should keep your phone's battery.

Here's how to — and how not to — charge your phone.