Camera: The Galaxy S5 has a 16mp camera with a capture speed of 0.3 secs. You can also shoot Ultra HD video with it, while the Htc One M8 comes with a 5mp camera setting so if you ask me, which is better? The answer is obvious.
OS: They both come with Android 4.4 KitKat
Let's talk about the battery power: The Galaxy S5 comes with a 2800mah battery that can last for more than a day. It also comes with a power saving function. Whereas the HTC One has a 2600 mAh battery and it is more durable than the older HTC One. HTC One (M8) also has a power saving function. The two gadgets are higher than their similar older generation.
Storage: When it comes to storage, if you ask me, I will say there is no major difference, but lets detail it out. The Galaxy S5 comes with 16GB and 32GB on-board storage variants, with micro SD support for cards up to 128GB, and also 50GB of free cloud storage for two years through dropdox. While the HTC One comes with its own 16GB storage, micro SD space that can take up to 128GB, and 65GB of free Google Drive space. As you can see, there is not much difference between the two gadgets when you compare their storage capabilities.
Display: If you ask me, which of the two devices, which has a bigger and better screen display, I will say that the difference is not much but lets take a look at their features.
The Galaxy S5 comes with a 5.1 inch screen display with 1920 x 1080-pixel resolution and 430ppi. While the HTC One also has a 5-inch display with a 1920 x 1080-pixel resolution with a pixel density of 441ppi. If you look at it carefully, you will see that the S5 is a little bit bigger than the M8 in screen size while htc is higher in pixel density.