Upon first inspection, glycerol and mineral oil appear to be identical (or at least very similar) compounds: They're both colorless, (mostly) odorless, and have mild lubricating properties that make them feel slippery when rubbed between the thumb and index finger. Chemically, however, they are very different compounds.
Mineral oil is a hydrocarbon, meaning it contains nothing except carbon and hydrogen, with each molecule typically containing somewhere between 15 and 40 carbon atoms. It typically has a density of about 0.8 g/mL (meaning 1 millileter of mineral oil would weigh 0.8 grams). Mineral oil is not soluble in water: If the two are mixed, they will form separate phases, with the mineral oil on top.
Glycerol, also known as glycerin or glycerine, is actually an alcohol. Its molecules only contain 3 carbons, and it has a density of about 1.3 g/mL. Unlike mineral oil, it is soluble in water. In fact, it is hygroscopic, meaning glycerol will actually absorb water vapor from the air.
Mineral oil is a byproduct of the crude-oil refining process.
Glycerol is produced by the saponification of animal fats. Saponification is the reaction between fats and strong bases (like lye) and is the primary reaction involved in the manufacture of soap; glycerol is a byproduct of the soap manufacturing process.
Mineral oil is the primary ingredient of baby oil. It can also be taken orally as a laxative.
Glycerol is used in cough syrup (as a sweetener and thickener) and acts as a laxative in suppository form.
Food and Cosmetic Uses
Mineral oil is used in many topical creams and ointments.
Glycerol is used in foods as a sweetener and as a humectant (to keep foods moist). It is also used in toothpaste, shaving cream and soap.
Some mineral oils have been linked to cancer in animal studies involving exposure to oil mists.
Glycerol is not carcinogenic and is not believed to be toxic unless ingested in large quantities.