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 <inline-formula><tex-math id="M5">\begin{document}$10^{-9}$\end{document}</tex-math><alternatives><graphic xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="14-20230595_M5.jpg"/><graphic xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="14-20230595_M5.png"/></alternatives></inline-formula> for the relative error of effective refractive index, when the normalized step size is <inline-formula><tex-math id="M6">\begin{document}$10^{-4}$\end{document}</tex-math><alternatives><graphic xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="14-20230595_M6.jpg"/><graphic xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="14-20230595_M6.png"/></alternatives></inline-formula>. The fourth-order algorithm provides an ultimate accuracy of about <inline-formula><tex-math id="M7">\begin{document}$10^{-10}$\end{document}</tex-math><alternatives><graphic xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="14-20230595_M7.jpg"/><graphic xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="14-20230595_M7.png"/></alternatives></inline-formula> for the relative error of effective refractive index, when the normalized step size is <inline-formula><tex-math id="M8">\begin{document}$10^{-3}$\end{document}</tex-math><alternatives><graphic xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="14-20230595_M8.jpg"/><graphic xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="14-20230595_M8.png"/></alternatives></inline-formula>. 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.