Millipedes and centipedes serve important roles in terrestrial and arboreal habitats around the world; millipedes serve as decomposers involved in nutrient recycling, while centipedes are predators of invertebrates and small vertebrates. To prevent dessication, both must dwell in damp retreats, so you are likely to encounter them in similar places -- under rocks, logs and debris. The two are somewhat similar in appearance, but centipedes are usually flat, while millipedes are often rod-shaped. Other differences in appearance and behavior set them apart, as well.
Both centipedes and millipedes are joint-legged invertebrates of the phylum Arthropoda. In light of their shared ancestry, scientists classify centipedes and millipedes into their own group, the subphylum myriapoda, which means “many legs.” The 2,500 living centipede species form the class Chilopoda, while 8,000 extant millipedes comprise the class Diplopoda.
Centipede literally means “100 legs,” while millipede means “1000 legs.” Unfortunately, neither is an apt moniker, as most centipedes have less than 50 legs, while millipedes move by using 40 to 400 legs. Some centipedes -- specifically those of the order Geophilomorpha -- have up to 350 legs. Nevertheless, you need not count the legs of these creepy crawlies to identify them; centipedes have one pair of legs per body segment, while millipedes have two pairs of legs per body segment.
In general, centipedes are quite fast, while millipedes amble along slowly. The predatory nature of centipedes requires them to be fast enough to capture their prey, while millipedes do not have to crawl quickly to capture decaying plant matter. Millipedes move in a straight line, and the movement of their legs looks like a wave passing down the side of their body. Centipedes can move in a straight line, but they often move in a laterally undulating manner, like a snake.
A centipede’s first line of defense is to use its speed to escape an attacker -- if this doesn’t work, they will use their venom. Centipedes deliver venom using their first pair of legs, which are highly modified and function like the fangs of a spider. Millipedes cannot not rely on speed or venom to defend themselves; instead, when threatened, a millipede usually curls into a defensive coil, which presents their hard shell to the predator and reduces the exposure of their soft underbelly. Once the millipede is in the defensive coil, it will emit noxious -- and in some species, poisonous -- compounds.