Welcome to Android Central!
As mentioned above me, you'll need to provide us with more details so we can try and help you.
1. Install a battery monitoring app like GSam Battery Monitor.
2. Which ROM are you using? Is it a custom ROM or stock ROM? And if it is stock, which Android version?
3. What apps do you have constantly running in the background?
4. Have you ever played around in the phone Settings in order to improve battery life?
HTC One (M8) - Tips for extending battery life - GETTING STARTED - How-tos - Support | HTC United States
5. How long have you had your device?
6. Go to Settings > Apps > Running and tell us which non-system applications are running.
Battery life has always been controversial on almost any touch-screen device ever since they were invented, and that's due to the fact that it almost entirely depends on the personal usage rather than the actual capacity of the battery. I can get more battery life on my device than on a device with a larger capacity by just tweaking certain settings and monitoring my usage.