Plasma-enhanced chemical vapour deposition (PECVD) SiNx is the typical choice as anti-reflection coating (ARC) for Silicon based solar cells. However, there still exists a room for improvement in passivation quality of SiNx while maintaining good optics for the front side of a solar cell. In this paper, we studied in detail the optical and electrical properties of SiNx layers by varying the chamber pressure and substrate temperature in an industrially used inline PECVD tool. Both the optical as well as electrical properties of SiNx layers were found to be significantly influenced by the chamber pressure and substrate temperature. A trade-off between excellent optics and low surface recombination is observed with an increase in chamber pressure, whereas higher substrate temperature generally led to better passivation quality. The Si-H bond density, which is expected to directly influence the quality of surface passivation, increased at high pressure and at low substrate temperature. Based on our investigations, a good compromise between optics and surface passivation is struck to prepare optimized SiNx layers and apply them as passivation layers for the front side of passivated emitter and rear cell (PERC) solar cells. The best solar cells show high short-circuit current density (jSC) of 39.9 mA/cm2 corresponding to the SiNx layers with low parasitic absorption, good antireflection property, and excellent passivation of the surface and bulk silicon. The current-voltage (I-V) results are found to be in agreement with internal quantum efficiency (IQE) measurements of the solar cells.