In this paper, a boundary element method (BEM) for cavitating hydrofoils moving steadily under a free surface is presented and its performance is assessed through systematic convergence studies, comparisons with other methods, and existing measurements. The cavitating hydrofoil part and the free surface part of the problem are solved separately, with the effects of one on the other being accounted for in an iterative manner. Both the cavitating hydrofoil surface and the free surface are modeled by a low-order potential based panel method using constant strength dipole and source panels. The induced potential by the cavitating hydrofoil on the free surface and by the free surface on the hydrofoil are determined in an iterative sense and considered on the right hand side of the discretized integral equations. The source strengths on the free surface are expressed by applying the linearized free surface conditions. In order to prevent upstream waves the source strengths from some distance in front of the hydrofoil to the end of the truncated upstream boundary are enforced to be equal to zero. No radiation condition is enforced at the downstream boundary or at the transverse boundary for the three-dimensional case. First, the BEM is validated in the case of a point vortex and some convergence studies are done. Second, the BEM is applied to 2-D hydrofoil geometry both in fully wetted and in cavitating flow conditions and the predictions are compared to those of other methods and of the measurements in the literature. The effects of Froude number, the cavitation number and the submergence depth of the hydrofoil from free surface are discussed. Then, the BEM is validated in the case of a 3-D point source. The effects of grid and of the truncated domain size on the results are investigated. Lastly, the BEM is applied to a 3-D rectangular cavitating hydrofoil and the effect of number of iterations and the effect of Froude number on the results are discussed.