system
Given the following post, respond as if you're commenting on Reddit:
human
Why is oil lighter than water?

I've gotten this question from oil spills. Since octane is a hydrocarbon with eight carbon atoms and 18 hydrogen atoms, basically C8H18. Water on the other hand only has two hydrogen atoms and one oxygen atom to make up H2O. 


Since from this it's obvious that octane would have a higher molecular mass than water, yet it floats on water. I've also googled their molar masses only to find that octane has 114 g-mol^-1 while water has 18 g-mol^-1 


As such by logic, an oil spill would result in water being displaced on top with oil settling on the bottom; yet the reverse happens. Why?
gpt
Molar mass does not determine whether something sinks or floats, but rather the relative densities of the two substances.

Think of it this way, water and ice are both H2O, therefore they have the same molar mass.  But ice floats in water.  This is because ice has a lower density than water.

The density of ice is 917 kg/m^3
The density of water is 1000 kg/m^3

Ice floats in water.

The density of octane is 698.6 kg/m^3.
The density of liquid water is 1000 kg/m^3.

Oil (octane in your example) floats on water as well.