The density of ice is much lower than the density of water.
When the water freezes and becomes solid, the air present in the water gets locked in between the frozen ice crystal structure.
The crystal structure of ice comprises cage-like structures and has a large number of empty spaces between the particles filled with air and the presence of these air voids give the ice its low density.
Therefore, The density of ice is much lower than the density of water which is the sole reason why ice floats on water.