OS: The operating system of the Sony Xperia Z2 is Android 4.4.2 KitKat upgradeable to 4.4.4, while the Samsung Galaxy S5 is also running on version 4.4.2 Android KitKat upgradeable to Android 5.0 Lollipop.
DIMENSIONS: The dimension for the Xperia Z2 is 5.78 x 2.89 x 0.32 inches while the Galaxy S5 is 5.59 x 2.85 x 0.32 inches.
DISPLAY: The screen size the Z2 is 5.2 inches compared to the S5 that is 5.1 inches. The difference in screen size is not too much. The Galaxy screen resolution is 1080 x 1920 pixels and it's the same as that of the Xperia smartphone.
SCREEN TYPE: The Sony Xperia made up of IPS LCD screen while the Samsung Galaxy S5 uses super AMOLED screen.
CAMERA: The S5 comes with a 16 mega pixel rear camera while Z2 also share the same 16 mega pixel rear camera quality. The Galaxy S5 has a front camera of 2.1 mega pixels, while that of the Sony Xperia is 2.2 mega pixels. The S5 have some camera features like, Phase detection autofocus, Effects, Self-timer, Autofocus, Voice activation while the Z2 has its own features, namely back-illuminated sensor (BSI), Autofocus, Touch to focus, Manual focus, stabilization of Digital image and stabilization of Optical image.
RAM: The RAM size of the Galaxy S5 is 2048 MB (2GB) while that of the Xperia Z2 is 3072 MB (3GB).
CPU: S5 has a Quad-core 2.5 GHz 400 processor, but Z2 has a Quad-core 2.3 GHz CPU - that is making S5 superior (the processing power is critical for better user experiences).
STORAGE: The Xperia Z2 features a 16GB of on-board storage, with MicroSD card expansion up to 128GB, while S5 features 16GB and 32GB on-board storage variants, with MicroSD support for cards up to 128GB, and 50GB of free cloud storage through Dropbox for 2 years.