An ammonia smell in the bathroom not only offends your nose, but it could indicate a serious problem with the bathroom. Ignoring the odor only will lead to it becoming worse, which may put the health and safety of anyone living in the house or using the bathroom at risk.
While the ammonia smell in your bathroom likely is not solely ammonia, which is dangerous to inhale, the smell still can pose a danger to you or anyone else in the house. The smell may be sewer gases, which are harmful for anyone to inhale for a prolonged period of time. Sewer gases can also be flammable, leading to a possible fire or explosion hazard in the house. Check the sewer vents on the roof to see if they're frozen or blocked, since this can cause gases to back up in the home.
The trap, or the curved pipe in the bottom of a toilet's bowl, is designed to keep sewer gases out of the house. The curved trap holds water in the pipe, creating a barrier to sewer gases. When you do not use the toilet for a long time, the trap will dry out. How quickly the trap dries depends on humidity levels in the house. With the water gone, the sewer gases can enter the bathroom. You can prevent this from happening by flushing less-used toilets periodically to keep the trap full.
A broken seal between the base of the toilet and the bathroom floor can lead to sewer gases escaping. The seal is made of a wax ring that compresses between the bottom of the toilet and a flange that anchors into the bathroom's floor and subfloor. Either part of the seal will break if the toilet is not anchored tightly enough, allowing the toilet to rock or move in any direction. Placing the wax ring so the curved side faces the flange and not the toilet also leads to leaks. You can repair the a broken wax ring by removing the toilet, scraping off the damaged ring and then installing a new ring. To repair a broken flange, you must anchor a repair strap over the flange.
Organisms that live in the sewer may find a way through the toilet's trap, especially if it dries out for a period of time, and take up residence in the bowl. The organisms will live just under the rim, by the portholes where the water from the tank drains into the bowl each time you flush. The rushing water over the organisms can let off some foul smells. A toilet brush and toilet cleaner will not eliminate the organisms. You must pour several cups of bleach down the toilet's overflow pipe, located in the tank, to eliminate the organisms and the smell.