How Minecraft levels actually work
XP points and levels are different currencies. Each level costs more points than the last: levels 0–16 cost a flat-ish 2×level+7 points each, levels 17–31 cost 5×level−38, and past level 31 every level costs 9×level−158. That is why going from level 39 to 40 costs far more than 0 to 1 — the calculator above applies this exact piecewise formula.
Where the numbers come from
A common zombie or skeleton drops 5 points, a blaze 10, and a Bottle o' Enchanting rolls between 3 and 11. Quest-style big payouts like the first Ender Dragon kill hand you 12,000 points at once — enough to jump dozens of levels early on. Because enchanting spends points rather than levels, knowing your point total tells you whether that level-30 table roll is actually affordable.