We derive a numerical method of calculating binary grating structures, which have predetermined gjatial spectra with a typical accuracy of less than one percent. As an experimental verification, we present test results of a grating that converts a plane wave into a central block of 11×11 uniformly diffracted waves.