Probability density function of the surface elevation of a nonlinear random wave field is obtained. The wave model is based on the Stokes expansion carried to the third order for both deep water waves and waves in finite depth. The amplitude and phase of the first-order component of the Stokes wave are assumed to be Rayleigh and uniformly distributed and slowly varying, respectively. The probability density function for the deep water case was found to depend on two parameters: the root-mean-square surface elevation and the significant slope. For water of finite depth, an additional parameter, the nondimensional depth, is also required. An important difference between the present result and the Gram-Charlier representation is that the present probability density functions are always nonnegative. It is also found that the ‘constant’ term in the Stokes expansion, usually neglected in deterministic studies, plays an important role in determining the details of the density function. The results compare well with laboratory and field experiment data.