Water molecules feature the combinations of hydrogen and oxygen atoms in a 2:1 ratio. Since they are present in a fixed ratio of mass, water molecules obey the law of constant proportions. Water is formed when two molecules of the diatomic hydrogen gas, combine with one molecule of the diatomic oxygen gas to produce two molecules of water.
2H2 + O2 → 2H2O
so in simpler words, we can say that the ratio of hydrogen to oxygen is 2:1, the ratio of hydrogen to water is 1:1, and the ratio of oxygen to water is 1:2.