Sandworms resemble the common earthworm. They have mostly light blue skin with purple and cream yellow stripes, a wide mouth flanked with blunt teeth, and small pupil-less, cyan eyes. In the Nintendo 3DS version, sandworms also have a yellow stripe of skin that mark their weak point.
In the Wii U version, sandworms are only found in Desert RuinsZone 1. On this version, they cannot be defeated by any means. They first appear in the 3D sections as towering obstacles that rise from sticky sand sections and remain stationary. Some sandworms spit acid balls which splash on the ground. The player will take damage by touching these sandworms and can get eaten by one while flying. In the 2.5D sections of the same Zone, different sandworms will charge in from the left, right or lower part of the screen when the player reaches a certain point. Getting eaten by these sandworms will cost a life, while touching them only cause damage.
In the Nintendo 3DS version of the game, sandworms appear in Desert Ruins Zone 1 and 3. These sandworms come in two variants, each with a different size and attack pattern. Medium-sized sandworms can be found burrowing between holes in linear pattern around arenas. Their only attack is spitting acid balls. On several occasions, defeating a sandworm is mandatory for opening Cases, which is needed to progress in the Zone. To defeat this sandworm, hit it with a Homing Attack or Somersault Kick to reveal its yellow weak spot, but avoid its mouth. Target then the weak spot with a fully-charged Focused Homing Attack to defeat the sandworm. Alternatively, the player can dash the Gray Quake into its weak spot for faster damage.
Another, giant sandworm appears near the end of Desert Ruins Zone 1. Upon encountering it, the player must keep moving forward. Meanwhile, the sandworm will track Sonic underground and occasionally pop out to try and eat him. When climbing hills, the giant sandworm will pop out from the wall to attack the player. A bumping shadow on the wall will indicate where it is about to emerge. At the end of the route, the player must use the Indigo Asteroid and built up its Asteroid Ring while the giant sandworm emerges from the ground to attack Sonic. As the sandworm emerges, hit its weak point three times to defeat it and unlock the local Case.
The Sandworms are based off of the famous sandworms of Arrakis from Frank Herbert's science fiction series, Dune. Like in this game, the sandworms of Dune are massive monsters that live in the open desert and attempt to eat anything that passes on the surface of the sand. In Dune, an approaching sandworm displaces copious amounts of sand as it draws near, a phenomenon called "wormsign"; this is replicated in the Nintendo 3DS version of the game, which shows the shadows of worms moving below the surface.
Sonic as the Crimson Eagle boosting past sandworm in the Wii U version.
A sandworm spitting out purple acid in the Wii U version.
Sonic climbing a ledge to avoid a sandworm in the Wii U version.