The assessment of wave energy resources is critical for site selection before deploying wave energy converters (WECs). Usually, a simplified wave energy assessment equation (SWEAE), using bulk wave parameters such as significant wave heights, peak periods, etc., is employed to estimate the wave energy flux. However, it neglects the effects of water depth on wave group velocities, thus being more suitable for deep waters. Considering most of the WECs are installed in nearshore zones or around islands, a more accurate wave energy assessment equation is needed. In the present work, a general wave energy assessment equation (GWEAE) for both shallow and deep waters is derived by introducing an explicit wave dispersion equation. Both GWEAE and SWEAE are applied in the assessment of wave energy fluxes in the coastal waters surrounding Qingdao City, China. Wave energy fluxes calculated by integration over all frequency and direction bins of the random waves, which can be regarded as the most accurate equation, are used for validating the two equations. It is demonstrated that the GWEAE significantly improve the accuracy of the wave energy estimation for various water depths compared with the SWEAE, especially for nearshore shallow water areas. Because the improved equation is free of integration calculations and iterative computations, it is a simple and accurate tool for estimating wave energy fluxes.