Minecraft enchantment order calculator — the cheapest way to combine your books
Add the books you have. The calculator searches every possible combine order and returns the one with the lowest total XP — plus the exact step sequence, using the anvil formulas from the Minecraft Wiki.
Target goes in the left slot, sacrifice (the book) in the right. Costs follow the Wiki formula: transferred enchantment value (book multiplier × resulting level) + both items' prior-work penalties, with +1 per incompatible enchantment. Single operations above 39 levels are refused in Survival.
Books only, one enchantment per book (the librarian-trading case). Mixed books from loot can be modeled by entering their enchantments as separate books — the total is the same only when no enchantment appears twice.
What this calculator actually solves
Combining six books onto one sword isn't a single anvil operation — it's five, and the order changes the price dramatically. Every operation adds a prior work penalty to the result (2ⁿ − 1, where n is how many times that item has been through an anvil), and that penalty is charged again on every later operation. Add books one at a time and the penalty compounds; pair them into a balanced tree and it stays small.
This tool enumerates the realistic search space — all binary combine trees and all left/right orientations — and returns the cheapest sequence. It's the same class of problem the Wiki's own order calculator addresses; ours also shows you the per-step breakdown and whether any step crosses the 39-level Survival cap.
How the cost is computed
Per operation, following the Wiki: cost = Σ(book multiplier × resulting level of each transferred enchantment) + penalty(left) + penalty(right) + 1 per incompatible enchantment. The result keeps max(penalty_left, penalty_right) + 1 — not the sum — which is exactly why the shape of the combine tree matters.
Full worked examples and the multiplier table are on anvil mechanics and the XP cost table.