When an item with the enchantment is held or equipped (in the main hand, offhand, or armor slots), collected experience orbs will repair the item at a rate of 2 durability per XP instead of adding the XP to the player's total experience. If multiple items have the enchantment, one will be chosen at random for each XP orb collected, and if the chosen item does not need repair, the XP will be added to the player's total as normal, rather than choosing another item to repair.
For example, fishing with a fishing rod costs 1 point of durability but earns 1–6 experience points when reeling in a catch. A damaged fishing rod used this way will eventually restore itself to full durability and any excess experience points will apply to the player's experience.
Mending and Infinity are mutually exclusive, meaning that only one enchantment can be granted on a given item in a survival based world. However, if combined using commands, both enchantments function as normal.