A dual-purpose socket has a body, pin base and a pin set. The body has a front side, a chamber defined in the body and at least one opening. The at least one opening is formed through the front side, communicates with the chamber and allows an HDMI or Displayport plug to be inserted into the chamber. The pin base is mounted in the chamber and corresponds to HDMI and Displayport plugs. The pin set is mounted on the pin base and comprises a detecting pin. When the HDMI or Displayport plug is inserted into the chamber of the body, the detecting pin will respectively not touch or touch a pin of the HDMI or Displayport plug. Since HDMI and Displayport plugs can be used, the dual-purpose socket improves convenience and cost for electronic device consumers and manufacturers.