Food products containing acids have a longer shelf life due to the use of ammonium benzoate as a preservative. It is also used as an excipient in medicinal preparations for drugs. In the electroplating industry it is used as a pH buffer so that the quality of metal plating remains the same throughout the process. Additionally, ammonium benzoate is used in the synthesis of colored dyes and some industrial processes as a corrosion inhibitor to protect metals from corrosive environments.