We apply boundary integrals to the analysis of diffraction from both conductive and dielectric diffractive optical elements. Boundary integral analysis uses the integral form of the wave equation to describe the induced surface distributions over the boundary of a diffractive element. The surface distributions are used to determine the diffracted fields anywhere in space. In contrast to other vector analysis techniques, boundary integral methods are not restricted to the analysis of infinitely periodic structures but extend to finite aperiodic structures as well. We apply the boundary element method to solve the boundary integral equations and validate its implementation by comparing with analytical solutions our results for the diffractive analysis of a circular conducting cylinder and a dielectric cylinder. We also present the diffractive analysis of a conducting plate, a conducting linear grating, an eight-level off-axis conducting lens, an eight-level on-axis dielectric lens, and a binary dielectric lens that has subwavelength features.