When water freezes into ice, the H2O molecules form Hydrogen bonds between each other and arrange themselves into an open lattice structure. This causes the molecules in ice to be further apart from each other, when compared to water molecules. This means that ice is less dense than water, hence why it floats.