According to NASA:
Pure water is perfectly clear, of course -- but if there is a lot of water, and the water is very deep so that there are no reflections off the sea floor, the water appears as a very dark navy blue. The reason the ocean is blue is due to the absorption and scattering of light.
The blue wavelengths of light are scattered, similar to the scattering of blue light in the sky but absorption is a much larger factor than scattering for the clear ocean water. In water, absorption is strong in the red and weak in the blue, thus red light is absorbed quickly in the ocean leaving blue.
Almost all sunlight that enters the ocean is absorbed, except very close to the coast. The red, yellow, and green wavelengths of sunlight are absorbed by water molecules in the ocean. When sunlight hits the ocean, some of the light is reflected back directly but most of it penetrates the ocean surface and interacts with the water molecules that it encounters.
The red, orange, yellow, and green wavelengths of light are absorbed so that the remaining light we see is composed of the shorter wavelength blues and violets.