We demonstrate an efficient numerical method for calculating transverse electric (TE) or transverse magnetic (TM) modal properties in a waveguide with an arbitrary refractive index distribution. We approximate a planar waveguide cross-section by a finite number of thin dielectric layers and use 2 × 2 transfer matrices to relate adjacent layers. Using a back-propagation method that is simple and computationally efficient, we solve for the vectorial field across the multi-layered waveguide and plot the mode profile. There is rapid convergence to a high-accuracy solution. We also obtain the number of guided modes and the propagation constant of each mode.