What is Nessler’s reagent?

Nessler’s reagent 

The basic solution of potassium tetraiodo mercurate (K2HgI4) is known as Nessler’s reagent. When HgCl2 is added with KI soln, a red ppt. of mercuric iodide (HgI2) is formed. Later if excessive KI soln. is added to it and then a Soluble compound of potassium mercuric iodide is formed. Then if this soln. is alkaline in KOH soln. the resulting basic soln. produced is called Nessler’s reagent.

It is used in identifying NH3 or NH4+ radical or ammonium salt.

2KI + HgCl2 = 2KCl + HgI2 (red ppt)

HgI2 + 2KI = K2HgI4