01
What detritus worms are
Detritus worms are small freshwater annelids, relatives of earthworms in the group Oligochaeta, many of them from the family Naididae. Almost every established aquarium has some: they arrive with plants, decor, gravel or even fish bags, and they live out of sight in the substrate, in filter sponges and in the mulm behind decor. There they eat decaying food, waste and the bacterial film that grows on it, which makes them part of the tank’s clean-up crew.
You usually only notice them when the population grows. They are thin and threadlike, white, cream or slightly translucent, and most are a few millimeters to about 1 inch (2.5 cm) long. They move with a wriggling, whipping motion, poke half out of the gravel, or swim in loose S-shapes when they leave it. Many reproduce by simply splitting in two, so numbers can rise fast when food is plentiful.
02
Worms in the fish tank: how to identify which one you have
Not every worm in a fish tank is a detritus worm. Check shape, head and movement with a magnifying glass or a phone camera zoomed in on the glass.
| What you see | Likely identity | Risk | What to do |
|---|---|---|---|
| Thin, round, segmented white worms wriggling in gravel or on the glass | Detritus worms | Harmless | Reduce food and waste (this guide) |
| Flat worms with a triangular head and two eye spots, gliding smoothly on glass | Planaria | Can harm shrimp, eggs and fry | Planaria guide |
| Very thin, unsegmented threads thrashing in tight S-shapes | Free-living nematodes | Usually harmless | Same approach as detritus worms |
| Red threads sticking out of a fish’s vent | Camallanus (internal parasite) | Serious | Isolate the fish, consult an aquatic vet |
| Thread-like thing attached to the fish’s skin, often with redness | Anchor worm (a parasitic crustacean) | Serious | Anchor worm guide |
| Tiny stalked animals with tentacles stuck to the glass | Hydra (not a worm) | Can harm shrimplets and fry | Reduce feeding, consider targeted treatment |
Anything attached to or coming out of a fish is not a detritus worm. Isolate the affected fish and get advice from an aquatic veterinarian or an experienced fish store before treating.
03
Why there are suddenly so many small worms in your aquarium
Detritus worm numbers follow their food supply. A sudden "outbreak" is a symptom, not the problem itself. The usual triggers are:
- Overfeeding: food that reaches the substrate feeds the worms directly. See our guide on how often to feed aquarium fish.
- Too little substrate cleaning: thick mulm in the gravel is a buffet for worms.
- A dirty or overloaded filter: sponges packed with sludge host large populations.
- Low oxygen in the substrate: when the gravel turns stagnant, worms leave it and appear on the glass or in open water. This is why they often show up all at once.
- A sudden change in water quality: a spike in ammonia, a big temperature change or a medication can drive worms out of the substrate, and a mass die-off can then foul the water.
- Few predators: in shrimp-only tanks nothing eats them, so populations look larger.
04
How to get rid of detritus worms step by step
You do not need to wipe them out, only to bring them back to invisible levels. These steps work because they remove the food, not because they kill the worms.
- Test the water first. Check ammonia, nitrite and nitrate with an aquarium test kit. A swarm combined with ammonia means the tank is overloaded.
- Cut feeding to what your fish finish in about one minute, once a day, for one to two weeks. Remove leftovers.
- Vacuum the substrate with a gravel vacuum. In planted tanks, clean only the open areas and do the tank in sections over several water changes.
- Change 25–30% of the water with dechlorinated water at the same temperature. Repeat weekly.
- Rinse the filter sponge in a bucket of tank water, never under the tap, so you keep the beneficial bacteria.
- Add aeration with an air stone or more surface movement. Our air pump guide lists quiet options.
- Remove dead matter: rotting leaves, dead snails, uneaten algae wafers.
- Let your fish help. Most community fish, such as tetras, Corydoras, loaches, gouramis and bettas, eat detritus worms readily.
05
Should you use a dewormer?
Dewormers based on fenbendazole or flubendazole do kill detritus worms, and some keepers use them against planaria or hydra. For detritus worms they are rarely justified. These drugs are toxic to snails and can harm some shrimp, and thousands of dead worms decaying at once can spike ammonia. If you ever use one, choose a product sold for aquarium use, remove snails first, follow the label exactly and be ready with water changes. Fixing feeding and cleaning solves the cause; medication does not.
Shrimp keepers can relax: detritus worms do not attack cherry shrimp or their young. They compete for the same leftovers, and a large population mainly tells you the tank is being overfed.
06
Common mistakes
Most problems come from treating a harmless scavenger like a parasite.
- Tearing down the tank and boiling the gravel: worms come back with the next plant, and you lose your bacteria colony.
- Overdosing salt or medications "to be safe": stresses fish and kills snails and shrimp.
- Replacing all filter media at once: restarts the cycle and can cause a bacterial bloom, see cloudy water.
- Feeding more because the fish "look hungry" while you are trying to starve the worms.
07
How to prevent worm outbreaks
Keep feeding modest, vacuum the open substrate at every water change and rinse filter sponges in tank water every few weeks. A regular routine like the one in how to clean a fish tank keeps both worms and nitrate down. Do not overstock, and keep some predators that pick at the substrate if your setup allows it. A few worms you see now and then are normal and even a sign of a living, mature tank.
08
When to worry
Detritus worms themselves are not a reason to see a vet. Act quickly, though, if worms die off in large numbers and the water clouds or smells, if fish gasp at the surface, or if ammonia rises: follow our guide on ammonia poisoning in fish and do daily partial water changes. If you see worms attached to fish or coming from their vent, that is a parasite problem: isolate the fish and consult an aquatic veterinarian.
Frequently asked questions
Frequently asked questions
Are detritus worms harmful to fish?
No. Detritus worms eat decaying matter and bacteria, not living animals. They do not attach to fish, shrimp or plants, and many fish eat them as a snack. Large numbers simply indicate excess food and waste, or low oxygen in the substrate, which are what you should fix.
Why are worms suddenly swimming in my fish tank?
Detritus worms leave the gravel when the substrate becomes low in oxygen or when water quality changes suddenly, for example after an ammonia spike or a big temperature swing. Test ammonia and nitrite, add aeration, vacuum the gravel and do a partial water change.
What are the small white worms on my aquarium glass?
If they are round, thin and wriggle, they are almost certainly detritus worms or nematodes, both harmless. If they are flat, glide smoothly and have a triangular head with two eye spots, they are planaria, which can harm shrimp eggs and fry. A zoomed phone photo usually settles it.
How long does it take to get rid of detritus worms?
Once you cut feeding and clean the substrate and filter, visible numbers usually drop within one to three weeks. They will never disappear completely, which is normal: a small hidden population is part of a healthy, mature aquarium.
Do detritus worms hurt shrimp?
No. Detritus worms do not attack shrimp, eggs or shrimplets. In shrimp tanks they may look more numerous because there are no fish to eat them. If your shrimp are dying, look at water parameters, not at the worms.
Sources and references
Written and reviewed by the handsoffmyhobby editorial team according to our editorial policy.





