H2o is a compound
H₂O is a compound because hydrogen and oxygen are chemically combined in a fixed atomic ratio. Each water molecule contains two hydrogen atoms and one oxygen atom. A mixture does not require that kind of chemical combination into a single substance.
Meaning and context
The formula’s subscript two applies to hydrogen. The absence of a written subscript after oxygen means one oxygen atom. Those atom counts are not the same as a two-to-one mass ratio.

Examples and usage
A sample of pure water is one chemical compound. Salt water contains water and dissolved material, making it a mixture. Calling a drink mostly water does not make the whole drink chemically pure H₂O.
What to check
Changing between ice, liquid water, and water vapor is a physical state change while the water molecules retain their identity. Chemical decomposition is a different process. Separate the formula of a substance from the composition of a real sample.
Explore more: Chemistry and Elements