Chests

Chests are pieces of Furniture that are used for holding items. The chest can hold up to 20 item stacks within a 5x4 space.

Chests can only be harvested with a hammer when empty.

Chests can also spawn underground and in other locations, they usually contain useful accessories and other treasure. These chests too can be harvested and brought home once empty.

In the initial version of Terraria, chests could be used to farm more chests when chests (filled with items) placed on sand were mined. This bug was fixed in 1.0.1; now sand on which a chest is placed will not be affected by gravity. Some chest-duping bugs still existed in 1.0.2, however.

Loot
The loot for any given chest is determined by the layer in which it is found. Each chest contains a single "rare item" and an assortment of randomly chosen common items. The rare item is first placed in the chest, then each set of common items is checked to see whether or not it will be added. If a set is chosen to be added then a single item from the list is added to the chest.

Underground
Underground chests are always Gold Chests.

Cavern
Cavern chests are always Gold Chests.

Underworld
Underworld chests are always Gold Chests. The first chest generated in the Underworld will always have a Dark Lance as its rare item. This will be the only chest in the Underworld with a Dark Lance in it.

Floating Island
The rare item in a Floating Island chest is more deterministic than other random chests. The first generated chest will have the first item on the rare item list, the second will have the second item and the third will have the third item. All floating island houses past the first three will then have a random rare item from the list.

Because of their location aboveground, aside from the rare item inside Floating Island chests have the same random loot as surface chests.

Dungeon
Dungeon chest color is determined by depth. Dungeon rare items are assigned one to each dungeon room much like the items on Floating Islands, except for the seventh room and beyond the chests use the rare item lists of the appropriate depth instead. Each dungeon only has one of each dungeon-specific rare item and there is a small chance that an item might not appear in the dungeon.

Underground Jungle
In addition to the normal Gold Chests below the surface, Gold Chests inside Shrines can be found in the Underground Jungle. These special shrine chests contain loot unique to the Underground Jungle.