Is ammonia (NH3) an acid or a base?
According to the Bronsted-Lowry theory and the Lewis theory, Ammonia (NH3) is a weak base

A lot of time we get confused about whether ammonia (NH3) is an acid or base because according to the Arrhenius theory, acids are those substances that can produce hydrogen ions in aqueous solution while bases are those substances which can produce hydroxide ions in aqueous solution. We know that NH3 cannot produce hydroxide ions in gaseous state but it produces the same product as when the two substances were in solution.
For example:
NH3(aq) + HCl(aq) => NH4Cl(aq) —- I
NH3(g) + HCl(g) => NH4Cl(g) —- II
Above reactions, we can find that the ammonia (NH3) is acting as a base in both cases. Therefore, the basic behavior of ammonia in the second reaction does not fit into the base definition of the Arrhenius theory.
The acid-base theory of Bronsted-Lowry provides clearer picture why ammonia acts as base in above reactions.
According to Bronsted-Lowry theory, substances that act as proton donors are called acids while those who accept protons are called bases. In reaction I, the reaction between hydrochloric acid (HCl) and ammonia is taking place in aqueous solution. In an aqueous state, HCl first reacts with H2O.
HCl(aq) + H2O(l) => H3O+(aq) + Cl–(aq) —- III
Now the ammonia (NH3) accepts proton this hydroxonium ion (H3O+)
NH3(aq) + H3O+(aq) => NH4+(aq) + H2O(l) —- IV
In this way, ammonia accepts proton from hydrochloric acid in aqueous solution. But if the reaction occurs in gaseous state ammonia directly accepts proton from hydrogen chloride gas.
NH3(g) + HCl(g) => NH4+(s) + Cl–(s)
In both the cases, ammonia is acting a base by accepting proton from acid.
We also know that reaction between acid (HA) and water is a reversible reaction.
HA + H2O <—-> H3O+ + A– In the forward reaction, HA acts as an acid while water act as a base while in backward reaction, H3O+ act as an acid and A– ion as a base. This reversible reaction contains two acids and two bases. An acid-base pair that differs by one proton is called conjugate pair. In our case, pair of HA and A– ion & pair of water and H3O+ ion are conjugate pairs. Here is one more example of conjugate pairs.

We have also noticed that water can act as a base as well as an acid. These types of substances are called amphoteric.

Similar to water, ammonia can also act as acid and base. Ammonia (NH3) is also amphoteric but NH3 cannot act as an acid in aqueous solutions because NH2– ion is a strong base due to which it is not stable in water. Ammonia can act as amphoteric in certain solvents only such as DMSO and liquid ammonia.
Now let’s see how Lewis theory of acids and bases proves ammonia (NH3) as a weak base.
According to Lewis theory, acids are those substances which can accept electron pair while those who donate electron pair are bases.
Now again let’s look at the reaction between ammonia and hydrogen chloride gas.
NH3(g) + HCl(g) => NH4+(s) + Cl–(s)
We know that chlorine is more electronegative than hydrogen atom which means HCl is a polar molecule. The electrons present in hydrogen chloride bond will get attracted more towards chlorine atom. This will make hydrogen and chlorine atom slightly positive and negative respectively.

In the above reaction, the lone pair in the nitrogen of NH3 will form a coordinate bond with a hydrogen atom and chloride ion will get separated from the HCl molecule. We can notice that the HCI molecule is accepting electrons from ammonia and hence HCl is acting as Lewis acid and ammonia (NH3) as Lewis base.

So we can conclude that ammonia (NH3) is a weak base according to the Lewis and Bronsted-Lowry theory and it can act as amphoteric in certain conditions only.
References
- Calculations in AS / A Level Chemistry – 20 Sept. 2000, by Jim Clark (Author)
- Amphoterism