[RPG] the mathematical formula for proficiency bonus vs level/CR

dnd-5emonstersproficiency

I'm programming a database for our homebrew setting and I would really like to be able to mathematically calculate proficiency bonus from a monster's CR, but try as I might, I can't find a formula that fits.

One of the answers to this question suggested that it was 1 + (level/4) rounded up, but that's wrong. For example, that formula would give a proficiency bonus of 2 for a level/CR 5 creature, when it's supposed to be 3.

Best Answer

Yes, it follows 1 + level/4 rounded up

While not actually given anywhere, the class (and multiclassing) tables and the monster proficiency tables (Monster Manual p. 8 and Dungeon Master's Guide p. 274) follow this pattern. CR 0 creates an exception to this which doesn't usually matter and which isn't neatly handled, so a full mathematical formula is:

$$ \text{Proficiency Bonus} = \begin{cases} 2, & \text{if CR = 0} \\ 1+\left\lceil\frac{\text{CR}}{4}\right\rceil, & \text{if CR $> 0$} \end{cases} $$


As for your example calculation; for a level (or CR) 5 creature, the equation would give $$1 + \frac{5}{4} \text{ rounded up} = 3$$

Note that is uses round up which means it always rounds up to the next, greater integer which is different to normal rounding.