The invention discloses a self-extinguishing device for a cable. The self-extinguishing device comprises an extinguishing sprayer, an extinguishing device body, an extinguishing starting button, a connecting rod, a pressure-applying lever, a direct-current electromagnet, a supporting rods, a wire, an extinguishing starting controller, a smoke-sensing temperature measurement probe, an on / off electrified indicator and a device shell, wherein the extinguishing device body is positioned at the bottom of the device shell, the extinguishing sprayer and the extinguishing starting button are respectively arranged at two ends of the extinguishing device body, the connecting rod, the pressure-applying lever, the direct-current electromagnet and the wire are connected to the extinguishing starting button in sequence, the support rods are respectively connected to the same sides of the pressure-applying lever and the direct-current electromagnet, and the extinguishing starting controller, the smoke-sensing temperature measurement probe and the on / off electrified indicator are connected to the wire in sequence. The self-extinguishing device mainly aims at fire outbreak of power cables, can realize self-extinguishing at the earlier stage of the fire, and thus the financial loss caused by spread of the fire can be avoided, and the self-extinguishing device for the cable has the advantages of small size and high extinguishing efficiency and is suitable for extinguishing fire on electrical equipment.