The most likely answer is a centipede: a fast, flattened predator with one pair of legs per body segment, typically 15 to 177 pairs depending on the species. Millipedes are the other strong candidate, and they are slower, rounder in cross-section, and carry two pairs of legs on most segments. If you also want to know whether either one is dangerous, the short answer is that both are essentially harmless to people — centipedes can pinch if handled roughly, millipedes mostly just smell bad.

Counting the Legs Tells You Which Bug It Is

The fastest way to sort out a long, many-legged creature is to look at how the legs sit on the body. Centipedes have one leg on each side of each segment, so the legs fan out to the sides and the animal looks flat when it runs. Millipedes have two pairs of legs on most segments, tucked underneath the body, so the legs look like a dense fringe and the animal looks cylindrical.

Centipedes usually have an odd number of leg pairs, and the count is fixed for the species: a house centipede has 15 pairs, while the long soil-dwelling centipedes people find under stones can have 30, 40, or well over 100 pairs. Millipedes almost always have an even number of legs, and many common garden millipedes have between 30 and 90 pairs, though the biggest tropical species carry several hundred legs. If the creature has fewer than 15 pairs and a soft, segmented body, it may not be a myriapod at all — see the lookalikes below.

Centipede, Millipede or Something Else Entirely

People often type "long bug with many legs" after seeing something that is not a myriapod. Here is how the main candidates differ in behaviour and body shape.

House centipede

Long, spidery legs that spread wide, a striped body, and a habit of darting across floors and walls at night. It is a predator that hunts insects, including cockroaches and silverfish, and it runs on the surface rather than burrowing. It reaches roughly 1 to 1.5 inches in body length, with legs that make it look larger.

Garden centipede

Flatter, with shorter legs and a reddish or brown body, found under stones, logs and mulch. These are the ones most often turned up during gardening. They are fast and will try to escape into soil rather than climb a wall.

Millipede

Round in cross-section, slow, and usually curled into a spiral when disturbed. They eat decaying leaves and wood. When threatened, many release a fluid that can stain skin and smell unpleasant, which is the main reason to avoid bare-handed handling.

Wireworm, symphylan, or larva

A thin, pale, many-legged soil creature under about half an inch with short legs bunched near the head is likely a symphylan or a larval insect rather than a centipede. These are tiny, fragile, and usually only noticed when a pot or compost heap is disturbed.

The one-leg-pair rule in practice

Pick the creature up in a jar and look at the underside. One leg per side per segment with a flat back means centipede; two pairs per segment with a domed back means millipede. That single check settles the identification in almost every case.

Is a Long Many-Legged Bug Dangerous in Your House?

No common centipede or millipede in a home or garden is medically dangerous to a person. Centipedes can deliver a painful pinch with their front legs, modified into forcipules, and a small number of large tropical species can cause more significant pain, but the ones found indoors in temperate regions are not a bite risk you need to treat as an emergency. Millipedes do not bite or sting at all.

The real hazard is the defensive fluid millipedes release. It can irritate skin and, in some species, temporarily stain it. If one has been on your hands, wash with soap and water. If fluid reaches your eyes, rinse with clean water for several minutes and seek medical advice if irritation persists.

Allergy and asthma are the exception worth knowing about. Shed skins and dried remains of large numbers of these animals in a damp basement can become airborne irritants. If you have a known allergy to arthropods or a respiratory condition and the sighting triggers symptoms, contact a doctor rather than relying on the identification alone.

Why They Show Up and What Actually Works

Both groups need moisture, because they lose water through their cuticle and dry out quickly. A centipede in a bathroom or basement is following prey and humidity. A millipede on a patio is usually migrating or feeding on decaying plant matter. Neither will breed in a dry, well-ventilated home.

The effective control measures are boring but reliable: fix leaking pipes and drips, run a dehumidifier in basements to keep the air below about 50 percent relative humidity, move mulch and leaf litter away from the foundation, and seal gaps around doors and utility penetrations. Removing the damp habitat removes the bug. In a garden, leave a strip of leaf litter if you want to keep millipedes as free composters — they break down dead plant material and are not plant pests.

Indoors, a jar and a sheet of paper are enough to move one outside. They curl, so a soft brush is easier than a vacuum, which can leave a smell and a stain in the canister.

Identifying a Specimen From a Photo

You see a creature roughly 2 inches long on a basement floor at night, moving fast, with legs that spread out sideways. Count the segments in the middle of the body and the leg pairs on one side: 15 pairs, one per segment, with a striped body and very long rear legs. That is a house centipede.

Now suppose the same shape is found under a flowerpot, is 4 inches long and brown, with 40 leg pairs visible on one side. That is a soil centipede of the kind that hunts in leaf litter, and the count tells you it is a different animal from the house species. If instead the body is round, the creature is slow, and you count roughly 60 legs on one side set low under the body, it is a millipede — 60 pairs means about 120 legs in total.

The arithmetic of the count is the whole method: leg pairs on one side, times two, gives the total legs. Odd pairs on a flat body point to centipede; even pairs on a round body point to millipede. When the count is unclear because the animal is curled, photograph it, release it outside, and let the shape of the back settle the question.