Abstract We present a set of efficient numerical algorithms to accurately compute the forces on dislocations in free-standing thin films. We first present a spectral method for computing the image stress field of dislocations in an isotropic elastic half space and a free-standing thin film. The traction force on the free surface is decomposed into Fourier modes by a discrete Fourier transform and the resulting image stress field is obtained by superimposing analytic solutions in the Fourier space. Dislocations intersecting free surfaces are discussed, including the use of virtual segments and the associated uniqueness of their solutions. The efficiency of the algorithm is enhanced by incorporating the analytical solutions for straight dislocations intersecting free surfaces. A comprehensive algorithm, including a flow diagram, is formulated and the numerical convergence of these algorithms discussed. As a benchmark, we compute the equilibrium orientation of a threading dislocation in a free-standing thin film. Good agreement is observed between the predictions from the dislocation dynamics model and those from molecular static simulations and the line tension model