Pick an item and select enchantments to see the total anvil cost in XP levels. Shows incompatibilities and the "too expensive" threshold.
Item
Enchantments for Sword
The anvil system, XP math, and the 'Too Expensive' limit.
Every enchantment applied through an anvil has a base cost in XP levels. Higher-level enchantments cost more, and rare enchantments (like Mending, Soul Speed, Swift Sneak) have higher base multipliers. The total cost is the sum of all enchantment costs plus a "prior work" penalty.
The prior work penalty doubles each time an item passes through an anvil. A fresh item has 0 prior work. After one anvil operation, its penalty is 1. After two, it is 3. After three, 7. After six operations, the penalty alone reaches 63 levels, which exceeds the 39-level cap and makes the item permanently unable to be enchanted further on an anvil.
This is why enchantment order matters. Combining books before applying them to the item reduces the number of anvil operations on the final piece. The optimal strategy: merge books in pairs (creating "super books"), then apply the combined book to the item in as few steps as possible.
Common questions about Minecraft enchanting.
More Minecraft tools.