A nondestructive technique for the reconstruction of refractive index profiles in planar waveguides is presented and analyzed. The approach is based on the integral scattering equations, which permit one to relate the refractive index of an inhomogeneous layer to the reflected field intensity at different incidence angles. From this formulation, an iterative algorithm is developed, such as at each iteration step the problem is formulated as the minimization of a functional representing the error between the measurements and the model data. The recovered profile is then used to improve the validity of the approximation in performing the next step. In this approach, the unknown index profile is represented as the sum of a finite series of basis functions avoiding to select a priori the particular functional form (e.g., Gaussian function, complementary error function, etc). The practical effectiveness of this approach is demonstrated by numerically simulating the measurements for different planar waveguides. The influence of measurement uncertainty and noise on the stability of the technique is also evaluated.