Although pure water itself is transparent, the color of the ocean appears blue due to phenomenon known as selective absorption and scattering of light.
When sunlight passes through the Earth's atmosphere and reaches the surface of the ocean,it contains all the colors of the visible spectrum, including red, orange, yellow,green,blue,indigo and violet.
Water molecules have the ability to absorb colors at different wavelengths to varying degrees.In the case of water,longer wavelength colors such as red and orange are absorbed more strongly than shorter wavelength colors like blue and green.
As a result,the blue and green wavelength of light are reflected and scattered by the water molecules in the ocean, making them dominant colors that our eyes,even though water itself is transparent.