A numerical procedure is presented for the solution of the inverse heat conduction problem. The method finds the desired heat flux in either the frequency domain through the inverse discrete transfer function, or in the time domain through the two-sided convolution with the discrete inverse impulse response function. The method is shown to be well conditioned, in the sense that it never yields heat fluxes oscillating with increasing amplitudes; and for unperturbed data, it does not require stabilization or regularization as the time step is decreased or the spatial discretization is refined. This discretization is carried out using the finite-element method. However, the method is also suitable for finite differences or any other discretization procedure. A series of numerical examples illustrate the accuracy and efficiency of the proposed method.