A numerical method for calculation of the electromagnetic field in two-dimensionally confined x-ray waveguides is presented. It is based on the parabolic wave equation, which is solved by means of a finite-difference scheme. The results are verified by a comparison to analytical theory, namely, Fresnel reflectivity and the weakly guiding optical fiber. (c) 2006 Optical Society of America.