Sword and Sorcery usually focuses on one or a few gritty heroes who are driven by survival, greed, revenge or desire. The world is dangerous, the magic is sinister, and the plot is often morally grey.
Sword and Sorcery stories are typically shorter, pulpy and may be novelettes, novellas or short novels.
Examples include Conan the Barbarian, Fafhrd and the Gray Mouser, Imaro, Elric of Melnibone, and Wulfric the Wanderer.
Heroic Fantasy focuses on multiple characters who are often driven by their morality, honor and sometimes destiny to save the princess, save the kingdom, and save the world. Magic is powerful and sometimes useful.
Heroic Fantasy stories are typically longer, more epic, and may be a trilogy or a long series.
Examples include the Lord of the Rings, The Wheel of Time, the Dragonlance Chronicles, The Sword of Shannara, and The Adventures of Wrathgar.
Some authors don't exclusively write one style of fantasy, but may write different subgenres of fantasy. Charles Moffat, for example, writes both Sword & Sorcery and Heroic Fantasy.

