In the present paper, a procedure able to quantify longshore sediment transport due to random waves is proposed. Starting from a model based on energy spectra, sea states are obtained by carrying out linear numerical simulations on the limit depth corresponding to the lowest one at which the spectral model can be used. In particular, the time histories of the surface elevation, from which the random waves can be deduced, are constructed. The random waves thus defined, considered wave by wave, are transferred to their proper breaking depths where the longshore energy flux factor and the immersed weight transport rate, which allow longshore sediment transport to be specified, can be derived. Moreover, the same quantities are evaluated with reference to the spectral wave related to the above sea states. An example involving a beach situated in the Ligurian Gulf, Italy, is proposed. The results obtained from the two procedures show that it is possible to interpret longshore sediment transport due to random waves through the behaviour of the relevant spectral wave.