USB cables usually have male connectors at either end of the cable, while USB sockets are female. USB cables are generally sealed units, as the wiring is intricate and complex. Wiring male-to-male USB cable is best done with a USB connector. USB cables were developed for use with devices that are close together, so if you make a cable that's too long, the quality of the data you receive will deteriorate. The recommended maximum length for high-speed devices is 16 feet and a little under 10 feet for slow-speed devices, according to the Universal Bus website.
Remove the USB cables from both devices, if connected.
Insert the end of one USB cable into the connector. You can only insert it one way. The connector is a simple unit and has two female sockets.
Insert the end of your second USB cable into the other side of the connector.
Insert the opposite ends of the two USB cables into your devices and you have wired a male to male USB cable.