Both snakes and worms move around the world by slithering or wriggling because neither type of animal has a means of locomotion beyond their long, cylindrical bodies. However, picking out differences between worm and snake species poses little problem for even the untrained eye, as they vary in fundamental ways: their skin, sensory organs, behavior and habitats. On a basic level, snakes exist in the taxonomic class Reptilia, while worms exist as a broad category including members such as flatworms, segmented worms and roundworms. A good starting point for distinguishing between a snake and a worm is size. While some worms may be larger than some snakes, typically, a snake is much larger.
TL;DR (Too Long; Didn't Read)
While snakes and worms have similarly shaped bodies, they differ in terms of behavior, biology and habitat.
Home Sweet Home
Both snakes and worms can be found across the globe, either on land or in water. Most continents (except arctic zones) and many bodies of water count worms and snakes among their ecosystems. However, worms have a larger spread across the globe and can live in areas unavailable to snakes. For example, parasitic ringworms can live inside other organisms, and earthworms spend the bulk of their lives burrowing through soil. While some snakes dig to some extent and many others live in burrows, they hunt and seek out sun above ground.
More Than Skin Deep
The outer layer of skin, or epidermis, on worms and snakes appears different and serves different functions. While most snakes have scaly exteriors, worm epidermises vary depending on the species. The common earthworm, for example, has a pink, segmented body, and it can breathe through its skin. While terrestrial snakes have dry bodies, most terrestrial worms excrete a layer of mucus to help them breathe and stay moist.
Just Take a Look
Snakes and worms navigate in different ways. Snakes flick their tongues to "taste" the air around them and seek out prey. They can also feel vibrations through their bones and bodies and have relatively keen sight. Worms, on the other hand, have a variety of different sensory organs. Earthworms and flatworms have light- and touch-sensitive cells at the front of their bodies, though they are not proper eyes.
Actions Speak Loudly
Snakes tend to play the role of predators in an ecosystem. Their keen senses, sharp teeth, and size or poison (rarely both) allow them to take down much larger prey. Some species can unhinge their jaws to eat their large kills. Predatory behavior in worms is rare. The Bobbit worm, for example, sits at the bottom of the ocean, waits for its prey to swim above it, and then quickly and violently snaps at it with its powerful jaws. Most other worms, such as earthworms, act as decomposers. Some, like leeches, act as parasites.