Biofilms commonly develop in flowing aqueous environments, where the flow causes the biofilm to deform. Because biofilm deformation affects the flow regime, and because biofilms behave as complex heterogeneous viscoelastic materials, few models are able to predict biofilm deformation. In this study, a phase field continuum model coupled with the Oldroyd-B constitutive equation was developed and used to simulate biofilm deformation. The accuracy of the model was evaluated using two types of biofilms: a synthetic biofilm, made from alginate mixed with bacterial cells, and a Pseudomonas aeruginosa biofilm. Shear rheometry was used to experimentally determine the mechanical parameters for each biofilm, as inputs for the model. Biofilm deformation under fluid flow was monitored experimentally using optical coherence tomography. The fit between the experimental and modeling geometries after fluid-driven deformation was very good, with relative errors of 12.8% for synthetic biofilm and 22.2% for homogenized P. aeruginosa biofilm. This is the first demonstration of the effectiveness of a viscoelastic phase field biofilm model. This model provides an important tool for predicting biofilm viscoelastic deformation. It also can benefit the design and control of biofilms in engineering systems.