In this paper, we analyze complex crack problems in elastic media using harmonic enrichment functions in a higher-order extended finite element implementation. The numerically computed enrichment function of a crack is the solution of the Laplace equation with discontinuous Dirichlet boundary condition along the crack, and its interaction with branches or other cracks is realized by imposing vanishing Neumann boundary conditions along those cracks. The classical finite element displacement approximation is enriched by adding the enrichment function of a crack through the framework of partition of unity. A nested subgrid mesh is used in the Laplace solve with a rasterized approximation of a crack, which simplifies the numerical integration—no partitioning of finite elements is required. Harmonic enrichment functions readily permit the extension to handle multiple interacting and branched cracks without any special treatment around the junction points. Several numerical examples are presented that affirm the accuracy and effectiveness of the method when applied to complex crack configurations under mixed-mode loading conditions. Copyright © 2010 John Wiley & Sons, Ltd.