although you can craft tnt by using the following http://www.minecraftwiki.net/wiki/Tnt gunpowder is very rare andi find it easier to get an innventory editor.
You craft sand and gun powder in a checker board pattern inside of a crafting table. Here is a link with more information and pictures: http://www.minecraftwiki.net/wiki/Tnt