Every year I teach my students the difference between the words “molecule” and “compound”. The difference is that these two words refer to two different concepts on two different size scales. A molecules is a collection of 2 or more atoms held together by a strong force in a set structure. Water (H2O), the oxygen in air (O2), the nitrogen in air (N2) and table sugar (C12H22O11) are common substances we encounter that are composed, at the atomic level, or molecules.
We will later will call this force a covalent bond, but that’s later on in the course. A compound, however, is a pure substance that has a set ratio of two or more elements. Water (H2O) is a compound that, at the atomic level, is composed of atoms. O2, is composed of molecules but is not a compound. It only contains atoms of one element, oxygen. There is another class of compounds, the ionic compounds, that are compounds that do not form molecules at the atomic level. Sodium chloride (NaCl, table salt) is composed of rows of ions (or a lattice), the ion pairs are not covalently bonded and will come apart (dissociate) when placed in water. In other words, ionic compounds are compounds that are NOT composed of molecules.
Every year we have to spend some time on this because it is a persistent misconception that molecules and compounds are the same things. It turns out that this is a much more persistent misconception than I thought. If you Google “definition of compound and molecule”, you discover many sites that don’t correctly explain the difference between molecule and compound. This site and this site and this site are just plain wrong. They all have some variation on the INCORRECT statement that “all compounds are molecules” and/or “but not all molecules are compounds”. This site (a .edu address!!) makes it sound like ionic compounds are formed from molecules.
In other words, not only should you not trust the internet, but this is one of those misconceptions that is hard to overcome, even for people who regard themselves as “experts”. I will fully admit that I didn’t have this distinction clear until I was a chemistry teacher myself (and I have a Ph.D. …).