An ammonia smell in the bathroom not only offends your nose, it could indicate a serious problem with the bathroom. Ignoring the problem 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 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 gasses, which are harmful for anyone to inhale for a prolonged period of time. Sewer gasses can also be flammable, leading to a possible fire or explosion hazard in the house.
The trap, or the curving pipe in the bottom of a toilet's bowl, is designed to keep sewer gasses out of the house. The curving trap literally traps water in the pipe, creating a block to sewer gasses. 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 gasses 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 gasses escaping. The seal is made up 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 and 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.