Minecraft wiki entry for Sword, associated text: A sword can be repaired in an anvil by adding units of the tiers' repair material, with each repair material restoring 25% of the sword's maximum durability, rounded down.