The answer to this question is a little trickier than you might think. Most substances get denser when they get cooler. If a substance is “denser” it means that its pieces are packed together more tightly than another substance.
All substances (water, air, mud, gold, granite, grape juice, tar, taco seasoning, every one of them!) are made of tiny pieces called molecules. Heat makes molecules excited. They jump around and move quickly! They need space to do this. Cold, on the other hand, makes molecules slow down and it can make them nearly stop. They don’t need as much room to move around and the space between them shrinks!
It would seem that cold water would have to be denser than warm water, but something strange happens to water when it cools to about 39° Fahrenheit. It starts to become ice, and it’s one of a few substances that actually take up more space as a solid than as a liquid. The molecules freeze in a shape with a lot of empty space between them. This is why ice floats on lakes and why ice cubes float in your drink cups. So cold liquid water is denser than warm water, until it becomes ice!