dnd 5e – What happens when you cast the Polymorph spell on a swarm?

DM Fiat, but you probably cannot target the swarm.

Note that the very first part of the monster stat block says:

“Medium swarm of Tiny beasts, unaligned”

Per the Polymorph spell description, you can only polymorph a creature. So it should be ruled that the spell cannot target a swarm, or at a DM’s discretion, that one beast in the swarm is changed with no effect to the rest (same AC, same hp, same everything).

As Rubiksmoose pointed out, the description text refer to the swarm as one unit. But it would be very clumsy to write out the sentences as individual beasts:

All the individual ravens that comprise the swarm can occupy another creature’s space and vice versa, and entire complement of the ravens within the swarm can move through any opening large enough for each one of the ravens. The entire swarm of beasts, nor an individual beast within the swarm, can’t regain hit points or gain temporary hit points.”

Related: Can a Druid Wild Shape into a Swarm or “Giant”?

Note that a Druid cannot Wild Shape into a swarm as they are multiple beasts. So it would be counter-intuitive that the reverse would work – that a swarm could polymorph into a single creature. Jeremy Crawford unofficially confirms this on Twitter here:

Wild Shape lets you transform into a single beast. A swarm is a collection of beasts, not one.