Damaged plugs and nicked, frayed cords are a safety hazard and need to be replaced. Putting a new plug on is straightforward, but there are a few basic rules.
To prevent shocks from the metal parts of a light, lamp cords and two-wire extension cords are always polarized. This means the plug has a small blade for the hot wire and a wide blade for the neutral wire, and the wires feeding those blades should not be reversed when you put a new plug on. Always use a polarized plug for a lamp, extension cord or any other cord that’s polarized to begin with. Don’t ever use a nonpolarized replacement plug with same-size blades to replace a polarized plug. (Nonpolarized plugs are often found on double-insulated tools and some appliances.)
You can identify the neutral side of the wire just by looking for markings on one of the wires. The most common identifier is ribbing in the rubber insulation all along one edge, but it can also be a white wire or a white stripe (photo below).
To prepare the cut end for a new plug, cut or pull the two sides apart, then strip off about 3/4 in. of insulation (Photo 1). Lamp and extension cords are usually 18 gauge, but if you’re not sure, strip the wire through the 14- or 16-gauge slot first. If it doesn’t strip cleanly, try the next gauge. Note: Stranded (“STRD”) wire gauges are marked on the left, solid gauges are marked on the right.
Twist the strands of wire tight, then fasten them into the replacement plug with the neutral on the wide-blade side (Photo 2). Then snap or screw the plug back together.