The infinite T-matrix completely describes the acoustic scattering properties of an obstacle. The T-matrix is extremely important for many applications because it is computationally cheap to use the T- matrix to simulate scattering for many different orientations of the obstacle or incident waves. The T-matrix is usually computed using the null ield method. However, the null field method is often numerically unstable for acoustically large obstacles or for obstacles with large aspect ratios. We describe an efficient and stable method for computing the T-matrix for sound-soft, sound-hard, absorbing, and dielectric scattering, using numerical far ield values obtained using any method. We demonstrate the algorithm by generalizing the recently proposed fundamental solution and non-polynomial inite element methods for the far field and T-matrix computations.