This Seawater Density Online Calculator is based on the equation of state from the book "Atmosphere-Ocean Dynamics" by Adrian Gill, Academic Press, 1982, Appendix 2 (properties of seawater), page 599. The equation of state is quite complex, it contains several components. The water density depends on water conditions - salinity, temperature and pressure.
In the world's oceans, the seawater has salinity of 34..36 gram per litre (g/l), the average value is about 35 g/l. Salinity varies across the oceans. Because seawater is denser than fresh water, fresh water floats above seawater, therefore, the upper layer of ocean water is less salty than lower layers, the lower layers are more dense than upper layers.
The second parameter is the temperature of the seawater, the density of seawater grows as the temperature goes down till it gets 4°C, the seawater has the higher density at this point. Below this point, the density getting lower, when the temperature gets 0°C, the seawater freezes.
The third parameter is the pressure, the higher pressure, the more dense the seawater, therefore the density increases with increasing depth.
Units used in this Online Calculator are: