Sting, found in the troll hoard at the Trollshaws, was made by the Elves in Gondolin, in the First Age. It is 23 inches long (24 in Scabbard, which was made of brown leather and reinforced with metal) and 3 inches wide at the hilt. The sword is described as leaf shaped, with gentle curving edges. This may just look like a dagger to the Elves and Men, but this is also a powerful sword. The blade glows blue when Orcs and Goblins are nearby, and is that sharp that it is the only sword to pierce Shelob herself.
Engraved on the blade and cross-guard are letters in Sindarin that read phonetically, Maegnas aen estar nin dagnir in yngyl im. Translated into English, they read, "Maegnas is my name, I am the spider's bane." Although it is not engraved in The Hobbit, so how the engraving found its way it’s oblivious.
Bilbo was the first owner of the sword in The Hobbit and he used it against the spiders in Mirkwood, who gave Sting its name.
Later on, in the Lord of the Rings, Bilbo gave Frodo the sword while they were both in Rivendell, before setting off in the Fellowship of the Ring. Frodo found the sword to be quite useful against their guide Gollum (who absolutely hated anything Elvish made). So this helped Frodo tame Gollum, or at least for a short time.
When Frodo was betrayed by Gollum in Shelobs lair, it was Sam that rescued Sting from the Orcs.