An integrated or fiber optic grating is a periodic modulation of the refractive index in a waveguide or on the surface of a waveguide. It can be fabricated by using either twobeam interferometry or near-field holography through an optical phase mask. Waveguide gratings play an important role in WDM systems since they can be used for controlling, combining, and routing light. OptiGrating 4.2 is based on the Coupled Mode Theory (CMT). The program has built-in mode solvers providing modal constants and fields needed to formulate the Coupled Mode Equations (CMEs). In turn, the Coupled Mode Equations are solved by using Transfer Matrix Method (TMM).