A finite difference scheme with a uniform mesh for planar waveguides with arbitrary refractive index profiles that takes full account of any smooth index variation and index discontinuity is derived for TE and TM-polarized waves. Discretizations that lead to a second-order error in the effective indices are given for TE and TM polarizations. At the computational boundaries, transparent boundary conditions are used. The scheme was implemented for anisotropic waveguides with a diagonal permitivity tensor and examined by using samples with various refractive index profiles, ranging from simple step- and graded-index up to complicated refractive index profile structures composed of either isotropic or anisotropic materials. For simple cases where the results of other methods are available in the literature, the proposed scheme shows very good agreement.