Defense

Defense is the number that determines how much damage can be absorbed per hit. Damage the player takes is reduced by half their defense value, rounded up.

Defense can be increased by equipping armor and accessories, or temporarily boosted by consuming Ironskin Potions and Bowls of Soup

Note that some forms of damage are impossible to reduce through defense. Damage from health-draining Debuffs like Cursed Inferno, drowning in water, or touching lava do not benefit from defense. Certain enemy damage types, such as cursed fire from The Twins, bypass player defense, making enemies that use those attacks quite dangerous regardless of player defense.

Mechanics
Defense (or Defense Rating) gives an arithmetic reduction in damage: i.e. reduces damage by a fixed amount per hit (as opposed to a geometric damage reduction, which reduces damage by a percentage).

Formula
The formula is: Damage Reduction = ROUND_UP(Defense * 0.5) For example, with 10 (or 9) Defense, a 20 Damage attack is reduced by 5, to 15 Damage.

Strategy
Because of this, high Defense is particularly effective against low damage attacks, which can be reduced almost completely, but not as effective against high damage attacks, where the reduction is just flat. This also means that added defense gets increasingly more important. A jump from 10 to 20 defense has smaller benefits on average than a jump from 30 to 40 defense.

Monsters
Monsters have the same Defense mechanics as players. Monsters with high defense will take virtually no damage from low damage weapons (e.g. Fire Imps take 5 damage from the Minishark with Musket Balls). Accordingly when fighting high defense monsters, high damage weapons are preferable.

Armor, Accessory and Debuff Defense
See Defense for full list. Here is a list of armors, accessories, and their respective defense bonuses, including any applicable set bonuses. As of the 1.2.0.3 update the highest possible defense bonus obtainable is 145. Turtle armor with Chlorophyte Mask gives 69 defense solely from armor. With accessory slots, you can then equip a Frozen Turtle Shell (+30 when below 25% health), a Paladin's Shield (+6), an Ankh Shield (+4), a Moon Stone and a Moon Charm, to provide a defense of 109 (110). If all these accessories have the warding attribute, that provides an additional 20 defense, totaling 129 (130) defense. At night, the Werewolf (buff) and Moon Stone will provide an additional 7 defense for a total of 135 (136) defense. Adding an Ironskin Potion and either a Bowl of Soup or Cooked Marshmellow to grant an additional 10 defense, for a total of 145 (146) defense