Abstract. Dendritic growth is a nonlinear process, which falls into the category of self-organizing pattern formation phenomena. It is of great practical importance, since it appears frequently and, in the case of alloys, affects the engineering properties of the resulting solid. We describe a new finite element algorithm for the two–dimensional Stefan problem, where the free boundary is represented as a level set. This allows to handle topological changes of the free boundary. The accuracy of the method is verified and several numerical simulations, including topological changes of the free boundary, are presented.