In Galerkin's method, an orthogonal set of functions is used to convert a differential equation into a set of simultaneous linear equations. We choose the Hermite-Gauss functions as the set of orthogonal basis functions to solve the eigenvalue problem based on the two-dimensional scalar-wave equation subject to the radiation boundary conditions at infinity. The method gives an accurate prediction of modal propagation constant and of the field distribution. The method is tested by using the step-index optical fiber, which has a known exact solution, and the truncated parabolic profile fiber, for which trends are well known. We also test the method using square and elliptic core fibers. The method is found to agree with known results.