A stool ammonia test is a quantitative measurement of the concentration of ammonia gas (NH3), a byproduct of protein metabolism in the intestines. Ammonia is primarily produced by intestinal bacteria (flora) that break down undigested proteins and urea, which reach the colon via bile. Elevated levels in stool may indicate increased activity of these proteolytic bacteria or a large amount of undigested protein, and may be associated with certain medical conditions.