Sword

Swords are Weapons used to defeat Mobs or players (if multiplayer PvP is on) quicker, but are not required to defeat them. They also can remove several blocks faster than using bare hands (such as Leaves, Wool and Soul Sand), but instead of one use of the Durability Bar, it counts as two uses. Killing larger slimes with a sword will also prevent more slimes from spawning from it, and in The Nether you can find Zombie Pigmen that use Golden Swords, but they do not drop their swords when killed.

Crafting
Swords are created with 1 stick and 2 units of a tool material:

The following table summarizes the damage that different quality swords inflict.