Ammonia and pH in aquariums have a complicated relationship. Aquarium water pH is influenced by dissolved chemicals like organic compounds and inorganic mineral salts; and ammonia is a natural component of fish waste and organic breakdown. Understanding pH and ammonia are critical to keeping your fish healthy.
The pH of Ammonia
Pure ammonia actually has a basic or alkaline pH. So in theory, ammonia should raise the pH of an aquarium. However, virtually all processes in the aquarium that produce ammonia, as well as the breakdown of ammonia produce hydrogen cations. Since pH is the negative log of hydrogen cation concentration, increasing this lowers the pH, negating the mildly basic pH of ammonia. So while ammonia has a basic pH, the processes that create it in an aquarium produce enough hydrogen ions to overcome this and lower the pH.
Sources of Ammonia
Ammonia comes from several biological processes in the aquarium. Most of these processes come down to breaking down proteins. In a fish's metabolism, they break down proteins from the food they eat and produce toxic ammonia as a byproduct. This releases ammonia, and hydrogen ions. Since ammonia is a weak base, the hydrogen ions have a stronger effect on pH, so this process ultimately lowers the pH. Rotting plant and animal matter, as well decaying fish food, also undergo a similar process that produces ammonia and hydrogen ions.
The Ammonia Cycle
In a healthy aquarium, bacteria break ammonia down into less toxic forms. A first set of bacteria break ammonia down into nitrite. A second group of bacteria turn the nitrite into nitrate. The various bacteria also release even more hydrogen ions throughout this process which lowers pH. The process typically takes several weeks to a month to establish in new aquariums. Without this process, toxic ammonia would continue to build up until the water became toxic to fish.
How pH Effects Ammonia
While the processes that create ammonia affect pH, the aquarium's pH can also influence the ammonia. In an acidic aquarium, ammonia actually becomes less toxic to fish. It is never good to have ammonia in an aquarium, but it is "less bad" in an acidic situation. However, some species of fish prefer water with a high pH. They include African cichlids and all saltwater fish. In water with alkaline or basic pH, ammonia is much more toxic. On top of this, water for these fish often contain powerful buffers -- pH-stabilizing minerals -- requiring meticulous aquarium maintenance.