Method for rooted devices:
1. Discharge your phone fully until it turns itself off.
2. Turn it on and let it turn off again.
3. Plug your phone into a charger and, without turning it on, let it charge until the on-screen or LED indicator says 100 percent.
4. Unplug your charger.
5. Turn your phone on. It's likely that the battery indicator won't say 100 percent, so plug the charger back in (leave your phone on) and continue charging until it says 100 percent on the screen as well.
6. Unplug your phone and reboot. If it doesn't say 100 percent, plug the charger back in until it says 100 percent on screen.
7. You want to repeat this cycle until it says 100 percent (or as close as you think it's going to get) when you start it up without being plugged in.
8. Now, install the Battery Calibration app attached below and, before you launch it, make sure your battery is at 100 percent again, then reboot.
9. Immediately launch the app and recalibrate your battery stats.
10. Once you've calibrated your battery, discharge it all the way down to 0 percent and let your phone turn off again.
11. Fully charge the battery one more time without interruption while it's switched off, and the Android system's battery percentage will be reset.
Note that all the app does is wipe the accumulated data from the batterystats.bin file giving you a new clean slate to work with. This method is also called, "training the battery" and should be performed infrequently. Maybe once every four months or so.