This paper presents a computational technique based on the extended finite element method (XFEM) and the level set method for the growth of biofilms. The discontinuous-derivative enrichment of the standard finite element approximation eliminates the need for the finite element mesh to coincide with the biofilm–fluid interface and also permits the introduction of the discontinuity in the normal derivative of the substrate concentration field at the biofilm–fluid interface. The XFEM is coupled with a comprehensive level set update scheme with velocity extensions, which makes updating the biofilm interface fast and accurate without need for remeshing. The kinetics of biofilms are briefly given and the non-linear strong and weak forms are presented. The non-linear system of equations is solved using a Newton–Raphson scheme. Example problems including 1D and 2D biofilm growth are presented to illustrate the accuracy and utility of the method. The 1D results we obtain are in excellent agreement with previous 1D results obtained using finite difference methods. Our 2D results that simulate finger formation and finger-tip splitting in biofilms illustrate the robustness of the present computational technique. Copyright © 2007 John Wiley & Sons, Ltd.