5e rates a fight by comparing the monsters’ XP to your party’s XP budget. Every character has four XP thresholds by level — easy, medium, hard, and deadly. At level 1 those are 25, 50, 75, and 100 XP; add them up across the whole party to get the party’s thresholds.
Next, total the XP of every monster in the fight and multiply it by an encounter multiplier based on how many monsters there are — more monsters get more actions each round, so the same XP is deadlier when it’s split among many creatures. Compare that adjusted total to your party thresholds to see whether the fight lands as easy, medium, hard, or deadly.
2024 rules note: the 2024 Dungeon Master’s Guide simplified this — it gives each character a single XP budget for a low, moderate, or high difficulty and drops the multiplier entirely, so you just add monster XP and compare. This calculator handles the math either way. To build the actual monsters and story to fit, use the AI encounter generator.