Amongst the two, I'd say S4. Have a look at HTC One as well. One flaw is, its got an average camera. If you are used to sharing images to social networking sites only, then it wont be that big a deal.
If you are willing to wait for a few months (say till Jan-Feb next year), then you will find better options, as the S5 are rumoured to be launched in Jan, you can expect the next version of HTC One as well.
As filegrasper said, tell us what are your primary requirements.
I would rate Xperia Z as a preferred choice if you are comparing with s4. The reason is simple. Galaxy s4 has a lot of bugs like heating problem and the 8 core cpu which never works at a same time. Octa core CPU is just a hype by samsung.. If you are looking for a true octa core cpu on phablets then wait for galaxy s5. Galaxy S5 will have a true 8 Core(Octa Core) CPU which will work simultaneously...lol
I had Sony Xperia SL (2K12 Flagship). Sony have great design and much better UI than TouchWIZ.
But about the performance am really worried(benchmark results), the last year flagship(XSL) was nothing when compared with S3 (except camera, 1080p videos).
I heard about Overheating in S4, is it really matters ?? Xperia SL had overheating (1.7Ghz CPU), the new firmware solved that issue.
I've used Z1, Z, S4 and Note 2 and the order of preference for me, would be: Z1 > Note 2 > Z > [email protected] BlacklistedI've got XL (cost me about Rs. 20k and it beats S3 in terms of benchmarks etc and now you can get the same phone for 15k and yeah we all know about the relationship between Samsung and Antutu benchmark score )
The S4 is a great device, but Samsung is making it harder to root and run ROMs with it due to them rolling out KNOX. I should clarify. Root is still easy, but you trip a flag in the bootloader "KNOX Flag" and you void your warranty for good. There's no way to reset it as of yet.