Swordtails constantly peck because they are grazing fish: their natural diet includes algae, biofilm, tiny invertebrates and organic debris, and captive fish spend much of the day picking at surfaces to find these foods. Constant pecking is usually normal foraging behavior, but it can also signal hunger, boredom, poor water quality, or a fish that is picking on a tankmate.
Swordtails (Xiphophorus hellerii) are livebearers in the family Poeciliidae, the same broad group as guppies, platies and mollies. In the wild they live in streams and pools in Mexico and Central America, where food is scattered and unpredictable. A fish that did not spend its day searching would go hungry, so the pecking instinct is deeply built in. Understanding what the fish is actually doing when it pecks — and when the behavior crosses into a problem — helps an owner decide whether anything needs changing.
What Swordtails Are Actually Doing When They Peck
Most pecking is a feeding behavior called grazing. A swordtail's mouth is small and forward-facing, suited to nipping at surfaces rather than biting chunks out of things. When a swordtail hovers over a leaf, a rock or the glass and makes repeated quick taps, it is usually scraping off algae, biofilm (the thin layer of bacteria and microorganisms that coats underwater surfaces) or tiny organisms living in that film.
This is why swordtails often peck in the same spots again and again: those surfaces regrow their film. It also explains why pecking increases on surfaces with visible green or brown growth and decreases in a spotless tank where the fish has already cleaned everything edible.
- Grazing on algae and biofilm — the most common explanation.
- Picking at leftover food — flakes and pellets that settle on plants or gravel.
- Hunting microfauna — tiny worms, daphnia-like organisms and other small life in the tank.
- Nipping a tankmate — a different behavior that looks similar at a glance.
- Investigating a new object — new plants, decor or a hand near the glass.
Normal Foraging Versus a Problem
The key distinction is what the fish is pecking and how the pecked-at target responds. Pecking at plants, rocks, driftwood and glass is generally harmless. Pecking at another fish is not, especially if the target is smaller, slower or has long fins.
Swordtails are not usually aggressive toward unrelated species, but males can be pushy with each other, and any swordtail may nip at a fish that is weak, sick or much smaller. A fish that repeatedly pecks one specific tankmate — rather than surfaces — is showing a social problem, not a feeding one. Signs that pecking has become a problem include:
- One fish is being chased and pecked at consistently, with torn fins or missing scales.
- A fish hides in a corner or behind the filter to avoid another fish.
- The pecking fish ignores food to pursue a tankmate.
- Plants are being shredded rather than lightly grazed.
- Pecking is accompanied by gasping at the surface, clamped fins or lethargy, which points to water quality or illness rather than appetite.
A common misconception is that a fish pecking at the glass is trying to escape or is stressed. In most cases it is simply grazing on the biofilm that grows on glass, which is one reason aquarium glass develops a faint haze between cleanings.
Why Swordtails Might Peck More Than Usual
A sudden increase in pecking usually has an identifiable cause. The most frequent ones are dietary and environmental.
- Underfeeding or an unbalanced diet. Swordtails need both plant-based matter and protein. A diet of only dry flakes may leave them searching constantly for something more. Offering a varied diet — quality flakes or pellets plus occasional blanched vegetables such as zucchini or spinach, and small amounts of live or frozen food — reduces frantic foraging.
- Boredom in a bare tank. A tank with few plants, no driftwood and smooth surfaces gives a grazing fish little to work with. Live plants, rocks and driftwood create surfaces where biofilm grows naturally and give the fish something to do.
- Poor water quality. High nitrate, low oxygen or accumulated organic waste can make fish restless. Regular partial water changes and good filtration keep conditions stable.
- Overcrowding. Too many fish in a small volume increases competition for food and space, which can intensify both foraging and nipping.
- New tankmates. Introducing a new fish can trigger territorial pecking while the hierarchy settles.
- Breeding activity. Males may peck or nudge females during courtship, and females about to give birth may behave differently.
Telling Grazing Apart From Nipping
Grazing and nipping look similar but differ in target and pattern. A grazing swordtail works across a surface in short, repeated taps, often moving slowly along a leaf edge or rock face. A nipping swordtail follows a specific fish, approaches from behind or below, and darts at fins or the body. The pecked fish reacts — it flees, hides or turns to face the pursuer.
If the target is a plant, check the damage. Light grazing leaves the leaf intact. Heavy damage shows frayed edges, holes and stripped stems, which usually means the fish is hungry or the plant is soft and palatable. Some plants are more vulnerable than others, and a swordtail that has developed a taste for a particular plant may keep at it.
Water Quality and Health Checks
Because restlessness can be an early sign of a water problem, a basic check is worthwhile whenever pecking behavior changes. Test for ammonia, nitrite and nitrate, and confirm the filter is running and the water is not too warm. Swordtails tolerate a range of conditions but do best in stable, well-oxygenated water with regular partial changes.
Watch the fish itself as well. A healthy swordtail is active, has clear eyes, intact fins and a rounded belly. A fish that pecks constantly but looks thin may not be getting enough food, either because it is outcompeted at feeding time or because its diet is inadequate. A fish that pecks while showing white spots, clamped fins or labored breathing needs a health review rather than a feeding change.
Practical Steps to Reduce Problem Pecking
- Feed a varied diet in small amounts more than once a day, so fish are not constantly hungry.
- Add live plants and driftwood to create grazing surfaces and break up sightlines.
- Keep the tank appropriately stocked and provide space for each fish.
- Maintain filtration and do regular partial water changes.
- If one fish is being targeted, separate it or rearrange the tank to disrupt established territories.
- Observe for a few days after any change to see whether the behavior settles.
Frequently Asked Questions
Is it normal for swordtails to peck at the glass?
Yes. Glass develops a thin biofilm that swordtails graze on. Repeated tapping at the glass is usually feeding behavior, not distress.
Why is my swordtail pecking at another fish?
This is nipping rather than grazing. It often reflects a territorial or dominance issue, especially among males, or a fish targeting a weaker tankmate. It should be monitored and separated if injuries appear.
Do swordtails eat algae?
They graze on algae and biofilm as part of a varied diet, but they are not dedicated algae eaters and should not be relied on to control an algae problem.
Why is my swordtail pecking at plants?
Soft plants can be grazed or damaged, particularly if the fish is hungry or the diet lacks plant matter. Offering blanched vegetables can reduce pressure on plants.
Can pecking mean my fish is sick?
Pecking alone is not a sign of illness, but if it comes with lethargy, clamped fins, gasping or a thin body, check water quality and the fish's overall condition.
How often should swordtails be fed?
Small portions two or three times a day suit their grazing habit better than one large feeding, with only as much as the fish clear in a couple of minutes.