Replace the end, don't splice it.
Yes, you can fix a damaged extension cord end safely—but only by cutting off the bad part and installing a new male or female plug. Never just tape over a split or melted end.
The trick is getting the right replacement plug for your cord’s gauge (thickness). Match the amp rating—most household cords are 16 or 14 gauge. Strip about ⅜ inch of insulation, separate the wires, and screw them into the correct terminals: brass screw for the hot (black or brass-colored) wire, silver screw for neutral (white or silver). Ground goes to the green screw.
After you tighten everything, give each wire a little tug to make sure it’s secure. Then close the plug housing. If the cord is frayed farther back than the last few inches, just buy a new extension cord—repairing a long damaged section isn’t worth the risk.
Don’t trust electrical tape to hold a bad connection. Heat buildup will melt it right off.