The budget below gets you into the right neighbourhood and no further. It tells you roughly how dangerous a fight will be on paper; it does not tell you how the fight will actually go once initiative starts. Read it for that much, and no more.
Every encounter has an XP budget, and building one is arithmetic before it is anything else. Pick a difficulty — Low, Moderate or High — and read the number in that column for each character's level. Add those numbers together to get your total budget, then spend it on monsters, whose XP values you add up the same way until you are close to the total.
| Character level | Low | Moderate | High |
|---|---|---|---|
| 1 | 50 | 75 | 100 |
| 2 | 100 | 150 | 200 |
| 3 | 150 | 225 | 400 |
| 4 | 250 | 375 | 500 |
| 5 | 500 | 750 | 1,100 |
| 6 | 600 | 1,000 | 1,400 |
| 7 | 750 | 1,300 | 1,700 |
| 8 | 1,000 | 1,700 | 2,100 |
| 9 | 1,300 | 2,000 | 2,600 |
| 10 | 1,600 | 2,300 | 3,100 |
| 11 | 1,900 | 2,900 | 4,100 |
| 12 | 2,200 | 3,700 | 4,700 |
| 13 | 2,600 | 4,200 | 5,400 |
| 14 | 2,900 | 4,900 | 6,200 |
| 15 | 3,300 | 5,400 | 7,800 |
| 16 | 3,800 | 6,100 | 9,800 |
| 17 | 4,500 | 7,200 | 11,700 |
| 18 | 5,000 | 8,700 | 14,200 |
| 19 | 5,500 | 10,700 | 17,200 |
| 20 | 6,400 | 13,200 | 22,000 |
The budget is per encounter, and every figure in it is per character — a party of four spends four times the number in the table. A High encounter is meant to be genuinely dangerous rather than lethal, but that assumes the party walks in with its resources intact. A group that is already low on spell slots and hit points from the last fight can find a Moderate encounter plays like a High one, which is why pacing across a session matters as much as any single budget.
Challenge Rating is a rough guide to how tough a single monster is, not a promise of how a fight involving it will feel. It is least reliable at the extremes — a very low CR monster can still kill a careless first-level character, and a very high CR monster can fold fast against a party built to counter exactly what it does.
It is also worth knowing that one monster at the party's level is usually a disappointing fight rather than a dangerous one. Four characters get four turns to a lone monster's one, so it is almost always dead before it has done much — the party simply gets to act more often than it does. Several weaker monsters that can all act in the same round are a much sharper test than a single strong one worth the same total XP.
The monster list carries every monster in the database, with its CR, and its CR filter is the fastest way to see what is available at the level you are building for.
CR alone will not tell you whether a monster is dangerous — glance at its stat block before you settle on it. Its Armor Class and its attacks are the two numbers worth a second look: a monster with a frightening CR but an unremarkable attack is a smaller threat than the numbers suggest, and the reverse also happens. This is only about choosing — for how a stat block plays out turn by turn once the fight starts, see Running a Combat.
The XP budget is a starting point. These four move a fight's difficulty further than its total ever will.
Numbers matter more than the total suggests. As above, several weak monsters that all act in the same round outpace one strong monster worth the same XP, because the party is contending with more turns, not more hit points.
Terrain changes what the numbers mean. Cover protects monsters that fight from range, and difficult terrain can strand melee characters exactly when they need to close the distance. The same monsters in an open room and a cluttered one are not the same fight.
An objective beyond "kill everything" changes what winning means. Holding a door, reaching the far side of a room, or keeping one NPC alive all put pressure on the party that a straight brawl does not, often without adding a single extra monster.
What the monsters do when a fight turns against them matters more than any of the above. Give them a reason to want out, and most fights end at the right time on their own rather than grinding on past the point they have made. For what that looks like at the table, see Running a Combat.