Two-dimensional crack problems, in common with other elliptic problems containing a boundary singularity, may be solved efficiently with the aid of a constrained finite element. The singularity is surrounded by a superelement containing a refined mesh whose interior nodal values are constrained to agree with the first few terms of the known expansion for the solution. The superelement conforms with linear or bilinear elements, and may thus be included in standard finite element programs. The calculation yields the expansion coefficients directly, and the method has been applied to determine stress intensity factors for a variety of two-dimensional configurations, including mixed-mode. The results are in excellent agreement with those obtained by other methods.