If you just need to calculate water density see the online interactive density calculator here.
You probably already know that density of water, like air, changes with temperature: when heated air becomes less dense. It is because the air is less dense when warmed that we commonly say "Warm air rises and cold air sinks." The change in density is not much but still enough to cause air to rise or convect. In the atmosphere, convection usually occurs because the air near the surface becomes buoyant from surface heating. For water, convection usually occurs during the night as surface waters cool, however, isn't completely true. For temperatures above 4° Celsius, water expands as it is warmed; for temperatures below 4° Celsius, water becomes more dense as temperatures rise. You can see the relationship between water density and temperature in the graph below.
Figure 1. Density of fresh water at temperatures above freezing.
This density change in water has important consequences in cooling rates over bodies of water. At night, as the surface of a body of water cools, the water becomes denser and begins to sink and mix with the warmer water below. In essence this prevents the surface temperature from dropping rapidly because a larger depth of water is cooling. Once the temperature of the surface water drops below 4°C, convection stops as the surface water becomes buoyant and remains at the surface. This allows ice to form on the surface much more rapidly.
Salt Water Density
As salt is added to fresh water, the density increases; this means that warmer, fresh water would float on top of colder, more saline water. Additionally, there can be two saline concentrations that have the density if the temperatures are different. For example, if the temperature of water is raised by roughly 3 degrees C and the salt concentration is increased by 1 part per thousand the overall density is about the same. The figure below shows this relationship in practical salinity units (1 psu is approximately 0.1% salinity).
Figure 2. Density of water for given concentrations of salt. Note that the temperature of maximum density decreases with increases salinity
Another interesting characteristic of the density of salt water is that as salinity increases, the temperature of maximum density decreases. This is shown by the red line in the figures above and below. It should also be noted that the freezing point for water decreases with increased salinity (blue line in the figure below). This is why putting salt on roads helps melt snow and ice faster. In the figure below, the freezing point and the maximum density point are shown to intersect at 24.7 psu. The area between the red and blue lines indicates the range where ice would form more rapidly.
Figure 3. Interactive plot: Density of water for temperature and Salinity changes.
As mentioned earlier, the maximum density of water affects the convection and ice formation in fresh water. For oceans, the salinity is usually 35 psu. For this level of salinity, the temperature of maximum density is below the freezing point which means as water cools on the surface, it will convect and mix with the water below. There are a few places in the world where salinity is below the critical 24.7 psu. For example, in the Siberian Sea there is water from rivers lowering the salinity and ice forms much sooner there than in other places.
Wadhams, P. , 2000: Ice in the Ocean. Routledge Curzon, 364pp.
CSG Computer Support Group, Inc csgnetwork.com