Monster Room

Dungeons are naturally generated structures that appear in the Overworld.

Generation
Dungeons generate naturally in the Overworld, almost anywhere underground, but they are most common around Layer 26, and frequent between Layers 16 and 42.

Structure
Dungeons are small rooms made of cobblestone and moss stone and contain a monster spawner and up to 2 chests. Finding a dungeon without a chest is very unlikely, but possible. Occasionally, a dungeon will spawn with its chests in such a way as to create a double chest. Dungeons generate with either a zombie (50% chance), skeleton (25% chance), or spider (25% chance) spawner. The spawner is always in the center of the dungeon room, with chests located around the walls of the room (large chests can connect with the short side against the wall) Each block of the floor has a 25% chance of being cobblestone, and a 75% chance of being moss stone. Dungeons will still generate if the 'generate structures' option is toggled to off.

Loot
Each dungeon chest block contains up to 8 item stacks, with the following distribution:

In Pocket Edition, cocoa beans and ink sacs can be found in chests.

This information was obtained from Minecraft's code. The generation algorithm places one of these items in a random slot in the chest eight times, possibly overwriting items already placed.

Video
''Note: This video was created before the release of. Since then, mossy cobblestone can be found in Jungle Temples (12w22a) and Mega Taiga biomes (13w36a).''

Trivia

 * Dungeons are almost always connected to a cavern, and because the cavern can be as small as a single block of air, the dungeon could completely overwrite it, usually resulting in a dungeon with no entrance.
 * It is possible, though almost impossibly rare for a dungeon to be generated at bedrock level, thereby deleting the bedrock. In which case digging through the moss stone can lead into the Void.
 * It is rarely possible for a player to find a dungeon with two spawners and up to 4 chests. This only occurs when a 5x5 dungeon spawns within a 7x7 dungeon, since the dungeon will remove any blocks from the walls or floor that open into a cave, the walls of the smaller dungeon will be removed, resulting in a 7x7 floor space with one spawner in the middle, and a second spawner adjacent or diagonally adjacent to the first.
 * Double-chest dungeons as shown below may have chests that form a perpendicular barrier between the wall and spawner (an exception to this would be in 7x7 dungeons, in which the chest cannot reach the spawner):