Defense

Defense is a player statistic 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 various buffs. In expert mode, defense stat works differently, as 75% of the defense stat reduces incoming damage, rounded up. With 58 defense, lava will only deal 36 damage to a player, making a significant difference with normal mode.

Some forms of damage are impossible to reduce through defense. Damage from health-draining Debuffs like Cursed Inferno, drowning in water or colliding with a boulder are not reduced by defense.

Mechanics
Defense 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 = Ceiling(Defense / 2) For example, with 10 Defense, a 20 Damage attack is reduced by 5 to 15 Damage.

Expert Mode Formula
In expert mode, the formula is: Damage Reduction = Ceiling(Defense * 0.75) For example, with 10 Defense, a 20 Damage attack is reduced by 8 to 12 Damage. (10 * 0.75 = 7.5; 7.5 is rounded up to 8)

Enemies
Enemies 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.

Defense boosts
See Defense for full list. Here is a list of armors, accessories, and their respective defense bonuses, including any applicable set bonuses.