No — not all bugs have six legs. Six legs is the defining feature of insects, and the word "bug" is often used loosely for any small crawling animal, so mites, spiders, centipedes, millipedes, woodlice and scorpions all get called bugs while having a different number of legs.
The confusion comes from two meanings of the same word. In everyday speech, "bug" means any small creepy-crawly. In biology, a true bug is a specific group of insects, and every insect has six legs. So the answer depends on which meaning of "bug" you are using.
Six Legs Is the Insect Rule, Not the Bug Rule
An insect is an animal with three body sections — head, thorax and abdomen — and three pairs of legs attached to the thorax. That gives six legs, and it holds for every insect: beetles, ants, bees, wasps, flies, butterflies, moths, grasshoppers, crickets, dragonflies, lice, fleas and true bugs.
The count is fixed because the legs grow from the thorax, which has three segments, and each segment carries one pair. Wings, where present, attach to the same section. If you find a small animal with more than six legs, it is not an insect, whatever it is called in conversation.
True bugs are a smaller group within the insects, with mouthparts built as a piercing beak. Bed bugs, stink bugs, boxelder bugs and cicadas are true bugs. Every one of them has six legs, so the strict answer to "do all bugs have six legs" is yes — but only because true bugs are a subset of insects.
Leg Counts for the Animals People Call Bugs
The table below gives the standard adult leg count for the creatures most often lumped under "bug." Counts refer to adults; larvae and nymphs can differ.
Six legs
Insects: ants, beetles, cockroaches, flies, bees, wasps, butterflies, moths, grasshoppers, crickets, termites, silverfish, earwigs, lice, fleas and true bugs such as bed bugs and stink bugs.
Eight legs
Arachnids: spiders, scorpions, ticks, mites and harvestmen (daddy longlegs). Spiders and scorpions have eight legs plus two more appendages at the front — the pedipalps — which are not counted as legs. Ticks and mites are also arachnids, so an eight-legged creature crawling on you is not an insect.
Many legs
Myriapods: centipedes have one pair of legs per body segment, and millipedes have two pairs per segment. Adults typically have from about 15 pairs up to well over 100 pairs depending on the species, so the total runs from roughly 30 legs to several hundred. Woodlice, which are crustaceans, have seven pairs of legs, giving 14.
Other counts
Crustaceans such as crabs and shrimp have ten or more legs depending on the species. Snails and slugs have a single muscular foot rather than jointed legs. Worms and caterpillars move on body segments or fleshy prolegs, not true jointed legs.
Why a Six-Legged Count Sometimes Looks Wrong
People often miscount because of appendages that are not legs. Antennae, mouthparts, pedipalps and tail structures get added to the tally. A spider has eight legs, two pedipalps and no antennae, so a quick glance can suggest ten appendages. An insect has six legs, two antennae and often two pairs of wings, and the wings are sometimes mistaken for legs when the animal is folded up.
Another source of error is life stage. A caterpillar has six true legs at the front and up to five pairs of fleshy prolegs behind, so it appears to have many legs, but only six are jointed legs. Maggots and grubs have no legs at all. Nymphs of insects generally already have six legs, while larval forms of some other groups differ from the adult.
Injured animals also break the rule in appearance. An insect that has lost a leg still belongs to a six-legged species, but you will count five. Use the body plan — three sections, legs on the middle one — rather than the count alone when identifying a damaged specimen.
Counting Legs to Tell an Insect From a Lookalike
Work through these checks in order and you will separate the common cases quickly.
First, count the legs and note where they attach. Six legs attached to a middle section means an insect. Eight legs with no separate middle section means an arachnid. Many legs along a long, segmented body means a centipede or millipede.
Second, look at the body. Insects have three clear sections. Spiders have two — a combined head and thorax, plus an abdomen. Centipedes and millipedes have many similar segments in a row.
Third, check for antennae. Insects have a pair; spiders do not. Fourth, look for wings. Most adult insects have them; arachnids never do.
A worked example: a small brown animal is found in a bed. It has six legs, two antennae, a body in three parts and no wings. Six legs plus antennae plus three body sections makes it an insect, and its flattened shape and habit point to a bed bug, which is a true bug. A different animal found in the same room has eight legs, two body sections and no antennae; that is a spider, not an insect, even though both get called bugs.
What the Six-Leg Rule Does and Does Not Tell You
The rule is a reliable first filter, not a full identification. Six legs confirms an animal is an insect, but it will not tell you which insect. Beetles, flies, bees and true bugs all have six legs, so you need wing structure, mouthparts and body shape to go further.
It also does not tell you whether an animal is harmful. Some six-legged insects bite or sting, and some eight-legged arachnids do too. Leg count says nothing about danger, diet or habitat.
For a suspected pest, catch it in a clear container and count the legs from above and from the side before deciding what it is. If you cannot identify it confidently and it may have bitten someone, keep the specimen and contact a pest control professional rather than guessing. For a bite that is swelling, spreading or causing breathing trouble, seek medical help.
The short version: insects have six legs, true bugs are insects, and the many other small animals called bugs usually do not have six. Count the legs, check the body sections and look for antennae, and you will know which group you are dealing with.