When fish go to the toilet, breath, or when plant matter decays, ammonia is produced. The bacteria in your filtration system consumes ammonia and keeps everything healthy and clean. However, if your filters are not working properly then this bacteria will start building up in the aquarium water, when there's enough bacteria present, the water looks cloudy, we then call this a "bacterial bloom"
I think it's probably worth mentioning that a bacterial bloom can occur in not just new tanks, but established aquariums as well. People sometimes experience cloudy water after they have cleaned their substrate. Gravel especially can harbour lots of nutrients that when released into the water after a gravel clean can sometimes encourage free swimming bacteria which in turn will cause cloudy water. However, you mustn't worry if this happens as it will probably disappear as quickly as it came. Another cause of a bacterial blooms is if you are a little bit overzealous when cleaning your filtration system. You must take great care when washing your media, if you remove too much bacteria then you may experience cloudy water as it will take a few days for the bacteria to catch up with the bio load. One very important thing to remember when either stocking your aquarium for the first time, or introducing new fish is will your filtration system be able to cope with the extra bio load that those fish will create? If you have cycled your aquarium using a few small fish then suddenly introducing a large Oscar maybe a little bit too much for the filtration to cope with, again this is when you may notice your water clouding up. So be careful when setting up your aquarium for the first time, don't add too many fish to begin with. The same goes with overstocking an aquarium, if there are too many fish for your filtration system then you will probably have permanent cloudy water.
Algae Can Cause Cloudy Water
An excessive amount of algae can also make your aquarium look cloudy. It's normally green algae that occurs in aquariums that are exposed to too much light, whether that be direct sunlight, or aquarium lights that are left on for too long. High nitrate levels will encourage algae to grow so if you don't carry out enough water changes you may experience green cloudy water. If you are experiencing green cloudy water then carry out extra water changes, reduce feeding and cut down the amount aquarium lighting the aquarium receives during the day.
A very good example of when fish tanks often go cloudy is when people bring a goldfish home from the fair and put it in a bowl. This practice is hopefully quite rare now, but years ago, people didn't think that their goldfish needed any filtration. Of course all fish produce waste (ammonia) and without the means to remove this, the water will turn cloudy. We would never advocate keeping fish without filtration. However if you do happen to be keeping a goldfish in a bowl without filtration then you should change the water on a daily basis ensuring toxins don't reach lethal levels. Always make sure that you use a water conditioner to remove chlorine. Remember that goldfish are cold water fish so there's no need to add heated water.
Your aquarium water may well look nice and clear when the lights are not switched on. However when you switch them on things look a little bit murky. It may not be a case that you have any problems such as a bacterial or algae bloom, it could be as simple as lots of bubbles in the water, especially if you've got a fairly strong filtration system.
Please be aware that the introduction of new substrate such as gravel or sand to an aquarium may well result in cloudy murky water. We always recommend cleaning sand or gravel before using it as substrate, however with all the will in the world there will always be a little bit of dirt or dust still contained within the substrate which is bound to cause a little bit of cloudiness in the water. This doesn't normally last for more than a day or two so let things settle if your water has turned cloudy after adding new substrate.
Treatments for algae and cloudy water
Below is a list of some basic mistakes that should be avoided if you don't want to wake up to a cloudy aquarium
One mistake many people make, normally newcomers to aquatics is to switch the filtration off at night, probably thinking that they are saving money. This is a major mistake that will completely wipe out your biological filter overnight. You will then have to cycle your aquarium over again. So never switch your filtration off for too long.
Another big no-no is washing biological media in the sink using tap water. I would say that 90% of newcomers have probably done this at one time or another. Water companies add chemicals to their water to make it safe for drinking. As soon as you pour it all over your biological media, you kill the bacteria straightaway. Again, you would have to cycle your tank over again.
Some medications contain chemicals that are very damaging to your biological filter. One of which is methylene blue which is often used to stop fungus growing on eggs. Always read instructions before adding medication to your aquarium.
Water conditioner should always be used when adding tapwater to your aquarium. Whereas small amounts won't pose a problem, a very large water change without using water conditioner could affect your biological filter, notwithstanding harming your fish. I've used all sorts of water conditioners over the years, however I would highly recommend as this stuff goes a long way so you get great value for your money. A large bottle should potentially last you several weeks of regular water changing.
Don't ignore cloudy water in your aquarium, it is a sign that there is either an imbalance somewhere, or your water may not be in the condition it should be. The best advice I can give any fish keeper is to get your own water testing kits so that you can test your water as soon as problems occur, rather than having to wait for the fish store to open.