What the enchanting table actually rolls
The table does not have a fixed list of enchantments it offers at a given level. It rolls a base number and then splits that number across three slots, and the only thing you control is how many bookshelves the table can see. This calculator shows the exact level range each slot can land in for your shelf count, so you know what you are buying before you spend the levels.
The underlying rule, from the Minecraft Wiki, is three lines long. With b usable bookshelves, the base roll is randomInt(1,8) + floor(b / 2) + randomInt(0, b). That base is then converted per slot: the top slot is floor(max(base / 3, 1)), the middle is floor((base × 2) / 3 + 1), and the bottom is floor(max(base, b × 2)). Because b appears in the bottom slot twice, shelves raise the ceiling on that slot steeply and the other two only gently — which is why the third slot is where the level 30 enchantments come from.
We did not take those numbers on trust. The three slot ranges for all sixteen shelf counts were reproduced by running every possible combination of the two random terms, and every one of the 16 rows matches the published table exactly. The table further down this page is that output.
How many bookshelves do you need
Fifteen usable bookshelves is the cap, and it is the only way to reach level 30. The ladder is not linear: no shelves gives a maximum of 8, five shelves give 15, ten give 23, and fifteen give 30. Each shelf is worth two levels at the top of the range but only about one and a half on average, so the last few shelves are the ones that matter.
A shelf only counts when it is placed exactly two blocks laterally from the table, on the same level or one block above it, with a clear gap between. That gap rule is the usual reason a table stalls below 30: on Bedrock the space between must be plain air, so a single torch or a carpet silently kills the shelf's contribution. On Java the gap may be air or a replaceable block such as snow or grass. If your maximum looks wrong, count the shelves that can actually see the table, not the ones you built.
Extra shelves past fifteen are decoration. A twenty-shelf library does not push the table past 30 — it just looks better.
Worked examples
Fifteen shelves, aiming for 30
The top slot can roll level 2 to 10, the middle slot 6 to 21, and the bottom slot always lands on exactly 30. The bottom slot is the one to use, and it costs 3 XP levels plus 3 lapis lazuli. Those 3 levels are worth 363 XP at that point on the curve — about 73 mob kills at 5 XP each — while the full 30 levels you spent climbing there are worth 1,395 XP in total. That gap is the reason to spend your levels at the table rather than hold on to them.
Ten shelves, mid-game
At ten shelves the bottom slot rolls 20 to 23 and the top slot 2 to 7. That is a real upgrade path: you can start enchanting iron gear at ten shelves without waiting for a full fifteen-shelf room, and the worst bottom-slot result still beats the best result at five shelves. Materials cost is the same 1/2/3 lapis regardless of level.
No shelves at all
With zero shelves the table caps at level 8 and the bottom slot rolls 1 to 8. This is the practical floor for early game: you can still get low-tier enchants on a fresh world, and it is worth doing rather than letting levels pile up unspent.
Bookshelf and level reference
| Usable shelves | Top slot level range | Middle slot level range | Bottom slot level range | Maximum level | Lapis 1 / 2 / 3 |
|---|---|---|---|---|---|
| 0 | 1–2 | 1–6 | 1–8 | 8 | 1 / 2 / 3 |
| 1 | 1–3 | 1–7 | 2–9 | 9 | 1 / 2 / 3 |
| 2 | 1–3 | 2–8 | 4–11 | 11 | 1 / 2 / 3 |
| 3 | 1–4 | 2–9 | 6–12 | 12 | 1 / 2 / 3 |
| 4 | 1–4 | 3–10 | 8–14 | 14 | 1 / 2 / 3 |
| 5 | 1–5 | 3–11 | 10–15 | 15 | 1 / 2 / 3 |
| 6 | 1–5 | 3–12 | 12–17 | 17 | 1 / 2 / 3 |
| 7 | 1–6 | 3–13 | 14–18 | 18 | 1 / 2 / 3 |
| 8 | 1–6 | 4–14 | 16–20 | 20 | 1 / 2 / 3 |
| 9 | 1–7 | 4–15 | 18–21 | 21 | 1 / 2 / 3 |
| 10 | 2–7 | 5–16 | 20–23 | 23 | 1 / 2 / 3 |
| 11 | 2–8 | 5–17 | 22–24 | 24 | 1 / 2 / 3 |
| 12 | 2–8 | 5–18 | 24–26 | 26 | 1 / 2 / 3 |
| 13 | 2–9 | 5–19 | 26–27 | 27 | 1 / 2 / 3 |
| 14 | 2–9 | 6–20 | 28–29 | 29 | 1 / 2 / 3 |
| 15 | 2–10 | 6–21 | 30–30 | 30 | 1 / 2 / 3 |
Slot level ranges and the maximum are the published values, and each row was independently reproduced from the formula by exhaustive enumeration of the two random terms. Lapis cost is fixed at 1, 2 and 3 per slot regardless of shelf count.
What the level cost really costs you
The level shown on the button is the number of XP levels deducted, not the level you must be at. Levels get more expensive as you climb, so the same three-level enchantment costs more XP at level 40 than at level 10. Converting levels into XP points makes the comparison honest:
- Levels 0 to 15 cost
2L + 7XP each - Levels 16 to 30 cost
5L − 38XP each - Level 31 and above cost
9L − 158XP each
That is why a level 30 enchantment is worth doing as soon as you have it rather than sitting on the levels: the XP you have already spent to reach that level is the expensive part, and the 3 levels you pay at the table are cheap by comparison.
Placement rules, and the mistakes they cause
- A torch in the gap. The most common cause of a stuck maximum. Clear the space between shelf and table, or move the shelf.
- Shelves one block too far. Exactly two blocks laterally, nothing at three. Corner shelves count when the diagonal gap is clear.
- Shelves below the table. They must be level with the table or one block above — a row set into the floor does nothing.
- Assuming more shelves means better enchantments. Past fifteen the ranges stop changing entirely.
- Expecting the top slot to be worse. The slots are independent rolls. A cheap middle slot occasionally surfaces a better combination than an expensive bottom slot, which is why the wiki itself warns not to read cost as quality.
Where these numbers come from
The formula, the slot ranges and the placement rules are all from the Minecraft Wiki's Enchanting mechanics article. Two independent checks were run before publishing: every possible value of the two random terms was enumerated for each shelf count from 0 to 15 and compared against the published slot ranges, and the level-cost conversion was checked against the XP curve used by our XP calculator. The tables on this page are the output of the first check; nothing here is copied from another calculator.
For the level-30 grind
Fifteen bookshelves and 3 lapis per roll only matter once you have the XP to spend, and that means a grind. These are the items a long enchanting session runs on.
- MMO gaming mouse — Grinding XP at a mob farm is hours of repeated clicks; a mouse with programmable buttons eases the repetition.
- Second monitor — Bookshelf layout and the level each slot can roll are easier to follow with the chart on a second screen.
- SSD — Enchanting sessions follow XP farms, which run in big worlds; an SSD keeps the loads between them short.
- Desk lamp — Enchanting is a night-time job in a dim room; a lamp keeps your lapis and notes visible without washing out the screen.
As an Amazon Associate I earn from qualifying purchases. The links above are affiliate links — if you buy through one, the price you pay is unchanged and a small commission helps keep these calculators free. Tools are listed because the job calls for them, not because of commission rates.
Sources and standards
Where these figures come from
Every figure on this page is implemented from the published reference material below, and re-checked against it before publishing rather than copied from another calculator.
- Minecraft Wiki — the base roll formula, the three per-slot conversions, the slot range table and the bookshelf placement rules.
- Minecraft Wiki — the fifteen-shelf cap, lapis lazuli costs and the level 30 maximum.
- Minecraft Wiki — the XP-per-level formula used here to convert a level cost into XP points.