CALCULATOR · XP COST

Minecraft XP Cost Calculator

Survival refuses any one anvil use that reaches 40 levels. Enter the item, books, and prior-work values to see the level bill before you open the anvil.

AD

XP cost calculator

Optimal order · XP cost · Too-Expensive guard
0 = brand new. Every anvil use raises this by 1.

Pick the gear you want to enchant. Books you add below will be merged onto it in the cheapest order we can find.

Books / sacrifices (1)
Optimize for

Worked example: 39 levels, still legal

Inputs: Sword with prior-work 5 (penalty 31); Sharpness V book with prior-work 2 (penalty 3). Cost breakdown: Sharpness V base 5 + prior-work penalties 34 = 39 XP. That is under 40, so survival allows the combine.

total = enchantment_cost + (2^item_pwp - 1) + (2^book_pwp - 1)
      39 = 5 + (2^5 - 1) + (2^2 - 1)
      39 = 5 + 31 + 3
      

Failure case: Too Expensive

Inputs: Helmet with prior-work 5 (penalty 31); Thorns III book (base cost 24). Cost breakdown: Thorns III base 24 + prior-work 31 = 55 XP. Survival prints Too Expensive and the helmet does not change.

Re-order books on the enchantment order calculator or start from a fresh item. The Too Expensive guide covers prior-work resets in more detail.

Prior-work penalty table

The live calculator adds these penalties for you. Use the table when you only know how many times the item has already been on an anvil.

Prior-work n Penalty (2^n - 1) Max extra cost that still fits (total 39)
0 0 39 levels of enchantment cost
1 1 38 levels of enchantment cost
2 3 36 levels of enchantment cost
3 7 32 levels of enchantment cost
4 15 24 levels of enchantment cost
5 31 8 levels of enchantment cost
6 63 None — already Too Expensive

FAQ

What does Too Expensive mean?
Survival anvils refuse a single combine whose total XP cost reaches 40 levels. The total is the enchantment cost plus prior-work penalties on both inputs. Creative mode ignores the cap; there is no vanilla gamerule to turn it off.
How is prior-work penalty calculated?
Each anvil use sets the result's prior-work to max(target, sacrifice) + 1. The next combine pays 2^n - 1 levels for that counter. A fresh item pays 0; prior-work 5 already pays 31 before the new enchantment cost is added.
Does Mending reset prior-work?
No. Mending repairs durability as you gain XP. It does not clear anvil history. A grindstone removes both enchantments and prior-work. The usual cheap fix is a fresh item plus a planned book order.
Why does 39 work and 40 fail?
The survival cap is 40, inclusive. The worked example below is 5 + 31 + 3 = 39 and is allowed. Add one more prior-work on the book and the same Sharpness V combine becomes 43 and is refused.
AD