A horde of kobolds hurl spears at a ranger. Masses of brainwashed soldiers open fire on your friendly neighborhood superhero.
Rolling for mobs of weak attackers can eat up game time. It's doubly bad since a weak attacker probably has a low chance to harm the target, so you are making lots of rolls for a low probability event.
These rules speed up the process. They work best when the attackers have the same stats (or can be considered to have the same stats to speed things up) and when attack and defense bonuses for both sides are basically the same from round to round. If those numbers shift, you have to recalculate.
1) Determine the DC for a single attacker to hit the target.
2) Subtract the DC from 21. This is how many different rolls on a d20 will hit.
3) Divide 20 by the result. This is how many attacks have to be made each round to hit once on average. We'll call the number of attackers it takes to meet this number a “gang.”
Example: Rumples the Ranger has AC 18, and the pirates have +1 to hit, so the DC to hit is 17. 21 minus 17 is 4, so 4/20 rolls on a d20 will hit (17-18-19-20). 20 divided by 4 is 5, so if there were five pirates they would hit about once per round, missing the other four times. Versus Rumples every five pirates = one pirate gang.
Now that you know how many attackers are needed to score a hit on average, just divide the attackers into gangs and that's how many hits they get each round. If five pirates are needed to score an average of one hit per round and twelve pirates are attacking, just round down and call it two hits per round (12/5 = 2.4). Now you just need to roll damage.
It may seem a little mathy at first, but if you take a few seconds and do this calc at the start of the fight the following rounds of combat will go much more quickly. Different targets (aka PCs) will have different numbers so calculate for each one. As opponents are killed all you have to determine is how many gangs can be made from the ones that remain.
If you miss the randomness of rolling for attacks you can use a single roll to simulate randomness for all the attacks. After all, dice are fun.
Roll a single d20 for each target being attacked regardless of how many gangs are attacking.
1-5 no hits
6-15 normal hits
16-20 2x hits
Example: Versus Rumples five pirates makes a gang. Twelve pirates are attacking, so that's 2.4 gangs, which we'll round down and call two gangs. Round 1 we roll a single attack and get a six (normal hits) so Rumples takes two hits. After rolling damage Rumples is doing fine, so Round 2 we roll another attack and get a 17 (2x hits) so he takes four hits. Things are starting to look bad for Rumples.
If you like more extreme results and think 20's and 1's should be special, use this result table instead:
1 no hits, attackers are disorganized and automatically miss next round
2-5 no hits
6-15 normal hits
16-19 2x hits
20 4x hits
Statistics note: The more dice you roll, the more the results become average. We're only rolling one die, which may seem to create extreme results but the distribution of the results has already been spread to mimic the results if you rolled a bunch of attacks separately.
If you want to simplify your calculations you can drop or round off fractions. Fractions are most important in cases where the number of hits is low. If the attackers can get 1.5 hits per round, the .5 is critical. If the attackers can get 3.5 hits per round, the .5 is less important.
If the number of hits is less than 1 the attackers will normally not hit every round. You can do a rough calc and average the hits across rounds (.5 will hit every other round).
Another option is to roll for the fraction each round as a separate check. Just take the decimal and see if you roll that or less on a d10 each round (or a d20, counting 11-20 as 1-10). If you do, it's another hit. You can roll both the d10 and the d20 for the main attack check at the same time.
Now go swarm those players with hordes of cannibals!