Millipedes don't all have the same number of legs; the amount of legs a millipede has will depend on how many body segments it has. Millipedes have two pairs of legs per body segment.
Though a millipede's name may seem to imply that it has millions of legs, this is a number that varies from millipede to millipede. They can be distinguished from centipedes because millipedes have two pairs of legs on each body segment instead of just one pair like centipedes. Millipedes' legs move slowly and in a wavelike motion, which may make it seem like the insect has many more legs than it actually does.