Marc_E
(Marc E)
16
The only non-destructive way i know how to tell the difference between a 2 (power only) and 4 (power and data) USB cable is to use it to connect a data device (phone, camera etc) to my PC and see if it shows up as a device (4 cable) or just powers on but doesn’t talk to the PC (2 cable).
Although if you’ve got small enough multimeter probes you could test for continuity at each end of the cable, i don’t have small enough probes though.
If you’re talking about knowing the difference when you’re buying then you need to choose a data cable. But if you’re going to use it for charging only then it doesn’t matter whether it has 2 or 4 wires, those extra 2 wires are not used for power transfer and as mentioned by Flydiver it’s the quality of the cable that matters so go with his/her recommendation, testing is the only way to know for sure and he/she has already done that for you 
HDMI is another matter though, it’s used for communication only, not to power a device, and as a standard it has built in error detection so the cable either works or it doesn’t (except for a very fine margin of error where it’s obvious you’re dropping blocks). If an HDMI cable is working there’s no way for another one to work better.
It’s the same with a USB cable, it either communicates or it doesn’t, a better USB cable won’t transfer data any differently (unless there is an obvious problem), it will only affect the power being delivered to a powered device which is a separate thing.
To summarise, for data a cable either works or it doesn’t, there’s no such thing as a ‘better’ cable. That applies to both HDMI and USB.
For USB charging, or USB power, you’re looking for the lowest resistance in the cables that transfer the power.