For lossless horns, there are many contours for which exact solutions of the so-called ``Webster'' horn equation are known. For quantitative work on brass instruments, however, it may be necessary to solve the equation for arbitrary contours, perhaps known only numerically from measurements of existing instruments. The present paper describes a numerical technique that is efficient and accurate. The effects of viscous and thermal damping at the walls of the horn are easily incorporated. Like most numerical methods for solving differential equations, this breaks the length of the horn into a number of smaller pieces. However, the pieces are not quasi-infinitesimal, but are initially as long as a quarter wavelength. The number of pieces is then increased and the error is estimated and reduced in a series of consecutive approximations using a method called ``the deferred approach to the limit.'' Where an exact solution is known (e.g., lossless exponential or catenoidal horn), results accurate to about six or seven decimal places are easily obtainable when the calculations are carried out with a resolution of about 15 significant figures.