The elastic moduli of a solid can be determined from the thermal fluctuations of the stress. The so-called stress-fluctuation approach is useful in that it can provide insights into the molecular origin of a particular mechanical response, and it leads to faster convergence than methods based on fluctuations of the strain. Unfortunately the implementation of the stress-fluctuation approach is more demanding than that of the strain- fluctuation approach, particularly for atomistic models involving intramolecular interactions se.g., bending and torsiond. In this study a simple numerical method is proposed to evaluate the elastic moduli of atomistic models from knowledge of atomistic forces. It is shown that this approach leads to fast and reliable prediction of the elastic moduli for two different classes of materials. In one example the elastic moduli of crystalline silicon are compared to those reported in the literature. In the other example the elastic moduli of an atomistic polymer model for polysmethyl methacrylatedare shown to be in good agreement with experimental data.