Magic sword refers to a sword that has magical power to grant the wielder supernatural strength or some other supernatural attribute. Magical swords can be legendary and fictional. Almost every nation that used swords has some instance of a magical sword if not more of them.
Magical property of the swords originate from the idea that sword making and metallurgy is in fact a magical process which was a common belief of the people in the ancient times. From fire and earth, which are also two magical elements, a metal is born and for it to be made into a quality sword a great concentration and skills are needed. Many cultures believed that even the commons words have souls, their own, of the wielder or of those that made them. So it is not surprising that magical swords started inhabiting myths and fiction. Even Bible has a few.
Flaming sword - is a sword glowing with flame granted by a supernatural power. In Bible, when Adam and Eve were banished from Paradise, God placed a Cherub with a flaming sword at the gates of Paradise. Surtur, the leader of the giants of Muspelheim in Norse mythology had one also.
Excalibur was the legendary sword of King Arthur which granted him rightful sovereignty of Great Britain and its scabbard protected its bearer from physical harm.
One more sword is tied to King Arthur: “Sword in the Stone”. Before he got Excalibur from the Lady of the Lake, Arthur pulled “Sword in the Stone” from the stone and because it was a feat that “only a true king could do” he obtained the throne.
God Frey, from Norse mythology, had a magical sword that attacked his enemies on its own free will.
One more Nordic magical sword is known as Tyrfing, Tirfing or Tyrving. It was made by dwarves Dvalinn and Durin who were prisoners of Svafrlami, king of Gardariki and Odin's grandson. He wanted a sword that would never miss a stroke, would never rust and would cut through stone and iron. They made it for him but cursed it as well to it would kill a man every time it was drawn, that it would be the cause of three great evils and that it would also kill Svafrlami himself. It did all that and much worse.
Similar to Tyrfing was Dáinsleif, which gave wounds that never healed and also could not be unsheathed without killing a man.
Beowulf had the sword Hrunting that was annealed in venom.
Japanese mythology has Kusanagi-no-Tsurugi, one of three Imperial Regalia of Japan. It was found in a dragon and used as a gift to settle an old grievance with the goddess Amaterasu. It could control the wind.
Roland, Frankish military leader under Charlemagne and one the principal figures in the literary cycle known as Matter of France, possessed a sword, Durendal, which was indestructible.
There are also many fictional magic swords. In the works of J. R. R. Tolkien, Gandalf uses his sword Glamdring which glows blue whenever orcs were nearby. Sting, which was worn by Bilbo, Frodo and Samwise had the same characteristic.
Prince Valiant wields the Singing Sword, which makes its bearer undefeatable if he fights for a good cause.
Elric of Melniboné has a sword Stormbringer in the works of Michael Moorcock. Main characteristic of the sword is that it can suck out the souls of its victims and transfer their energy to its holder.
In the Samurai Jack animated series, the titular hero has a katana which was forged of the pure spirit of good and is meant to defeat the evil Aku, antagonist of the series.