Battery percentage is extremely inaccurate

So my battery percentage on my iPhone 6 has been very inaccurate and unpredictable, like yesterday it shut off at 40% then when I plug it in it shows me 37%, at random the percentage would drop from about 30 to 7 then when I plug it in it jumps up to 15%. How do I fix this?
Hi,

First thing I'd recommend is to do a restore from a backup just to see if that helps. If not then next thing to try is set it up as a new device.

If the issue remains visit your local Apple Store
Try and calibrate it by charging up to 100%. Let it drain down to 1%, then charge it up to 100% again. It could just be the battery wearing out. With the iPhone 6, that could be it. Might be almost time for a new battery or an upgrade.

Original thread: https://forums.imore.com/threads/battery-percentage-is-extremely-inaccurate.381747/