A fish that repeatedly swims against the glass is usually reacting to something it sees: its own reflection, activity outside the tank, or a tank that feels small or bare. Sometimes it signals poor water or illness, so check those too.
Reflections
Territorial fish, such as bettas and cichlids, may treat their own reflection as a rival and keep displaying or charging at it. Dark backgrounds and dim room lighting make the glass act more like a mirror, which can make this worse. Researchers have seen male African cichlids spar with their reflections, so the behavior is a real one, not just a guess.
To test whether reflections are the cause, try a dark background on the outside of the back glass, or dim the room lights where the tank sits. If the pacing eases, you’ve found part of the answer.
Outside activity
Movement outside the tank can agitate fish. Other pets, people walking past, and glare from a window or TV can all set a fish off. Try moving the tank out of direct line of sight from pets, or reduce the glare.
Small or bare tanks
A fish with little to explore may patrol the glass out of boredom or stress. A tank with plants, hiding places, and varied decor gives it something to do and a place to retreat. If the tank is small for the fish you keep, a bigger tank may be the real answer.
Water quality
Poor water can make fish restless. Test ammonia, nitrite, nitrate, pH, and temperature. If you’re not sure how, learn how to test aquarium water first. Restless swimming that comes with clamped fins or gasping needs attention now, not later.
Pacing versus flashing
Pacing is steady swimming along the glass. Flashing is a quick rubbing or scraping against decor, the substrate, or the glass. Flashing can point to parasites, so if you see it, look closely at the fish for spots, a dusty coat, or frayed fins.
What to do
- Check the reflections and the room lighting.
- Reduce outside disturbances.
- Add plants, hiding places, and decor.
- Test the water.
- Watch for other signs of illness.
When to worry
If the pacing comes with clamped fins or visible spots, treat it as a health problem. Why is my fish not eating? If the fish has stopped eating as well, don’t wait for the pacing to improve on its own. Contact an aquatic veterinarian or an experienced fish store if the fish doesn’t improve after the changes above.