Defense

Defense simply is the number that determines how much damage can be absorbed per hit. Damage the player takes is reduced by their defense divided by two. Defense values are rounded up.

Defense can be increased by equipping armor and or accessories.

Mechanics
Defense (or Defense Rating) gives an arithmetic reduction in damage: ie. Reduces damage by a fixed amount per hit (as opposed to a geometric damage reduction, which reduces damage percentage based). Because of this, ironically, high Defense is particularly important against low damage attacks, which can be reduced almost completely, but not as important against high damage attacks, where the reduction won't be as effective.

Formula
The formula is:
 * Damage Reduction = ROUND_UP(Defense/2)

For example, with 10 Defense, a 20 Damage attack is reduced by 5 to 15 Damage.

Monsters
Monsters have exactly the same Defense mechanics as you. High defense monsters will take virtually no damage from low damage weapons (Skeletron takes 1 Damage from a Minishark+Musket Ball attack). When fighting high defense monsters, favor low rate of fire weapons but high damage weapons

Armor and Accessory Defense
Here is a list of armors, accessories, and their respective defense bonuses. The highest possible defense bonus (37) is obtainable by equipping full molten armor, as well as five cobalt shields or obsidian skulls or some combination thereof.