The electromagnetic fields in inhomogeneous dielectric gratings with periodic surface relief are analyzed using the combination of Fourier series expansion method and multilayer method. In the analysis the inhomogeneous region is divided into an assembly of stratified thin layers with modulated index, which is expressed by a fraction ƒ(z)/g(z), where ƒ(z) and g(z) are simple periodic functions. This method is applicable to a wide range of inhomogeneous dielectric gratings for both scattering and guiding problems. The order of the matrix to be solved depends only on the modal truncation number, not on the number of layers. Numerical results are given for the scattering problem of inhomogeneous dielectric gratings whose surface relief profile is sinusoidal and whose interior distribution of permittivity is a sinusoidally modulated type for both transverse electric and transverse magnetic cases. The influences of the incident angle and the frequency on the transmitted power are compared between the homogeneous medium and the inhomogeneous medium.