Abstract We apply a two-dimensional hybrid finite element-boundary element method to the analysis of diffractive optical elements (DOEs). We use the finite element method to solve Helmholtz's equation in the interior of a DOE and use the boundary element method, a Green's function approach, to determine the fields exterior to the DOE. We couple the two methods at the DOE surface by enforcing field continuity conditions. We validate our implementation by comparing its results to the analytic solution for diffraction from a dielectric cylinder and to the scalar solution for far-field diffraction from a dielectric slab. We use the hybrid method to analyse the diffraction from an eight-level phase lens and a binary-phase lens that has subwavelength features.