Soil effects are collectively referred to the influences that local geology and morphology of soil deposits have on ground motions coming from bedrock. The quantification of soil effects in building codes has a great impact in the design of structures because soil factors amplify the reference seismic input, which is typically defined for rock‐type soil class from probabilistic seismic hazards analysis. This topic, within earthquake engineering, represents one of the typical interfaces between structural engineering, geotechnical engineering and engineering seismology. In fact, this issue is generally addressed with different approaches depending on the background of the researchers. This article investigates soil effects combining the viewpoints of structural and geotechnical engineers and seismologists. It is shown that the averaging technique adopted for the definition of ground motion predictive models for spectral ordinates does not play a significant role in defining the results of rock‐like soil classes. However, for other soil classes characterized by soil effects, different methods of averaging the spectral ordinates produce significant differences. The main result of this study is the proposal of a new analytical formulation for the quantification of soil amplification factors for both acceleration and displacement response spectra. The proposed formulation is based on a database of real ground motions and simulated accelerograms. The latter have been obtained through stochastic ground response analyses, with the propagation of natural ground motions on rock‐like soil class through randomly generated soil deposits representative of different soil classes of Eurocode 8 and the Italian Building Code. The comparison between real and simulated data revealed the crucial role of soil nonlinearity in the definition of soil effects, which is also in relation with the variation of magnitude, fault distance and the intensity measures expected on outcropping rock.