A novel azo dye compound, Ethyl (E)-4-((5-hydroxy-3,4-bis(hydroxyl methyl)-6-methyl pyridin-2-yl)diazenyl)benzoate (EAB), have been synthesized by the coupling reaction and characterized by FT-IR, 1 H-and 13 C-NMR, Mass, and UV-visible spectroscopies. The nonlinear optical (NLO) properties of the EAB compound via the finding of the nonlinear refractive index (NRI) using continuous wave (cw), low power 473 nm, TEM00 mode laser beam have been studied via the diffraction patterns (DPs) and the Z-scan. Effect of power input of the laser beam, types of beam wavefront and temporal variation of the DPs are discussed. The all-optical switching (AOS) using two laser beams is proved to occur in this compound.