# Is there a mathematical formula to determine how much XP is needed per level?

Is there a mathematical formula to determine how much XP is needed per level? In other words Is there a consistent formula for determining how much XP is needed to go up to any given level?

I originally thought it was the previous amount times 2, but that doesn't work for all levels.

I understand that there is a character advancement table, but I'm curious as to how they got those numbers and whether there is some mathematical formula to work it out.

## No, there is no simple formula for level-by-level XP requirements.

WOTC has stated that the advancement rate is not constant across all levels. Rather, according to Unearthed Arcana: Three-Pillar Experience (August 2017), the standard XP and leveling system presented in the PHB

has faster advancement in a few spots [than the variant rules proposed in the UA.]

Note that although the quote comes from a UA playtest article, the quote itself is not playtest material -- it's the designers' commentary comparing the playtest material to the standard PHB rules.

And indeed if you look at the XP values required to advance from level to level, you won't be able to work out a straightforward mathematical formula for them, such as simple linearity or even exponentiality.

And the reasoning behind that less-than-straightforward system is clear: the designers wanted to make it faster to reach certain levels. For example, per Mike Mearls, the designers found through research that campaigns tend to stall at level 10, so they shortened the advancement track from 10 to 11.

• I find it curious (and amusing) that if there is no mathematical formula that was used, and WOTC offers none, that all the math majors worked hard and came up with some pretty insane formulas in other noted answers :) I'm also curious about Mearls' comment about how the designers determined that "campaigns tend to stall at level 10"... this implies that every DM and every character and every group and every roll of the die that ever occurs is generally the same! Boy I must be DM'ing completely wrong lol. Aug 26, 2021 at 4:50

After doing some interpolation I found that this equation was the best-fit (note $$\x\$$=level):

$$\text{XP}=3.7825 x^4-134.59 x^3+2572.6 x^2-10699 x+10703$$ However, it should be noted that this polynomial is unreliable until 5th level.

• Welcome to RPG.SE! Take the tour if you haven't already and see the help center or ask us here in the comments (use @ to ping someone) if you need more guidance. I made an edit to pretty up your equation, please double check I didn't bork anything up and ask if you have questions about the MathJax. Good Luck and Happy Gaming! Sep 2, 2019 at 16:23
• I don't doubt that this equation describes the data: the fact that you went up to five exponents means it should fit very well. However, that says nothing about whether this equation explains the data. I doubt very much that this formula was used by the designers to decide on the xp per level.
– Kirt
Aug 25, 2021 at 23:02
• After all this talk about polynomial fits, I decided to add a possible explanatory mechanism to my own answer. Aug 26, 2021 at 3:40

## Fitting XP by CR

Due to the non-uniform level pacing detailed here and in screamline's answer, it's more productive to fit a curve to XP rewards by CR (since this doesn't depend on the current level of the party and is therefore invariant to level pacing) rather than than XP needed per level. It turns out that a good fit using round numbers is

$$\text{XP} \approx 50 \left(\text{CR} + 1\right)^2$$

Here's a semilog plot: This is then modulated by the desired level pacing to get the XP requirements per level.

(However, it seems not as simple as the actual values being rounded from this equation. For example, it would be strange to round from 3200 to 2900 for CR 7. Also, the actual XP curve suddenly starts increasing rapidly above CR 20; it's best to consider that a separate regime entirely.)

I do not know of any direct designer statements that state that they intentionally chose a quadratic, let alone why they did so if they did. However, here's a possible explanation:

5e adopted the doctrine of bounded accuracy, where, according to designer Rodney Thompson:

The basic premise behind the bounded accuracy system is simple: we make no assumptions on the DM's side of the game that the player's attack and spell accuracy, or their defenses, increase as a result of gaining levels. Instead, we represent the difference in characters of various levels primarily through their hit points, the amount of damage they deal, and the various new abilities they have gained. Characters can fight tougher monsters not because they can finally hit them, but because their damage is sufficient to take a significant chunk out of the monster's hit points; likewise, the character can now stand up to a few hits from that monster without being killed easily, thanks to the character's increased hit points.

If damage and hit points both increase linearly with CR, their product increases quadratically. Granted, this does not take into account increases in attack bonus or AC, but if they play a lesser role then a quadratic may be a good-enough approximation.

In fact, under a Lanchester model of combat with a few additional assumptions, the estimated party resources consumed by an encounter is proportional to this product. It's a natural choice to award XP proportionally.

If you are using an Excel spreadsheet, you could use:

=CEILING(3.7825*Level^4-134.59*Level^3+2572.6*Level^2-10699*Level+10703,10^(LEN(ROUND(3.7825*Level^4-134.59*Level^3+2572.6*Level^2-10699*Level+10703,0))-2))

Exchange "Level" for the cell containing the Level value, and you would get a nice rounded value. But as noted in Nick's answer, the output for levels 1-4 does not reliably represent the desired XP values, but does pretty well from 5th level onward.

• Hi Daniel, welcome to rpg.se! Take the tour and visit the help center or ask here in the comments (use @ to ping someone) for more information. This is a great first answer, you could improve it slightly by mentioning how you calculated this or how it works. But overall a great answer. Thanks for participating and happy gaming! Apr 16, 2020 at 5:28

\begin{align} y ={}&\quad\ 5819.55617814588 - 11856.710519967924x + 7153.1988321984509x^2 \\& - 398.55230673086362x^3 - 1105.5094497604643x^4 + 462.03733563692845x^5 \\& - 80.142724143754521x^6 + 6.2081701486351601x^7 - 0.069480770175085027x^8 \\& - 0.016266981168801757x^9 + 0.0016558417135261892x^{10} \\& + 0.000069296325226162267x^{11} - 0.0000027175019434544397x^{12} \\& + 0.000000070646166571073877x^{13} - 0.0000000095150259370745423x^{14} \\& + 0.00000000028604436906456435x^{15} + 0.000000000012670491319511516x^{16} \\& - 0.00000000000032956267667046822x^{17} - 0.000000000000020151890236566283x^{18} \\& + 0.00000000000000056464447771396720x^{19} \end{align}

... does pretty well where x is your level and y is the XP requirement.

I applaud the much better answers to this question which attempt to fit a simpler curve; but just wanted to point out that you could fit a polynomial to this equation to get a perfectly accurate mathematical formula, but that doesn't mean you should! Such a formula is clearly even less useful than just trying to remember the list. Even this deliberately ridiculous polynomial is only accurate to a few percent. You need a lot more precision (or some more complex notation) to give you exactly what you want - but technically the answer is:

Yes; a mathematical formula to determine how much XP is needed for each level does exist. In fact there are infinitely many - and one such formula is just a more precise version of the one I've given above.

• Actually, it should give you the exact amount of XP per level when x=1,2,3,...,20. You just applied a classical result : it states that if you have $n+1$ couples of points $(x_i,y_i)$ then there exists a unique polynomial that passes (interpolates) the data. Aug 25, 2021 at 21:52
• Indeed that's what I did; (although presumably "of degree at most 19" is a necessary qualifier if you want to claim uniqueness). The classical result proves that such a formula exist; but I felt compelled to confess that the polynomial I've written doesn't quite pass through the required points. It isn't precise enough! Aug 25, 2021 at 22:00
• I think it depends on how you computed it (for example, using the Vandermonde matrix leads to a ill conditioned problem), on rounding errors and on machine precision. Aug 25, 2021 at 22:10
• When I tried it initially, I assumed it would be easy, and did something which looks similar to that Vandermonde matrix, running into much bigger compounding errors! So in the end I did some regression to fit it reasonably precisely on my 64-bit architecture without wanting to mess around with arbitrary precision - it fits much better. I've never learnt numerical analysis properly so I'm out of my comfort zone here - but given the size of the numbers involved, I think a more fundamental problem is that the exact Lagrange function solution requires more precision than my 64-bit words allow? Aug 25, 2021 at 23:03