Modal analysis of optical waveguides is a basic task in the design of advanced waveguide devices and optical circuits. How to deal with the problem of electromagnetic heterogeneous interface and absorption boundary condition are two major difficulties in implementing efficient numerical analysis of optical waveguides. Existing high-order accurate finite-difference modal analysis methods do not take into consideration the absorption boundary problem, which, thus, makes it difficult to accurately simulate leakage and radiation modes. Based on the immersed interface method and perfectly matched layer absorption boundary condition, a finite-difference method with the second- and fourth-order accuracy is proposed in this work. By using this method, the single-interface plasmonic waveguide mode, planar symmetric waveguide mode, and one-dimensional photonic crystal waveguide mode are analyzed. Numerico-experimental results show that the convergence rate of the second- and fourth-order algorithm are consistent with the anticipated order of the guided mode, leakage mode and radiation mode. The second-order algorithm provides an ultimate accuracy of about
$10^{-9}$
for the relative error of effective refractive index, when the normalized step size is
$10^{-4}$
. The fourth-order algorithm provides an ultimate accuracy of about
$10^{-10}$
for the relative error of effective refractive index, when the normalized step size is
$10^{-3}$
. Through the study of field distribution of guided mode and cladding mode in a one-dimensional photonic crystal waveguide, we show that the continuity of the field of transverse electric mode and its first derivative across the interface, and the continuity of the field of transverse magnetic mode and the discontinuity of its first derivative across interface, can be analyzed accurately. The method proposed in this paper can be used to calculate any mode for any refractive index profile, only by using the value of refractive index, independent of the specific functional representation of modal fields. The method provides a simple and efficient tool for implementing the modal analysis of step-index planar waveguides.