What molecular formulas actually represent in practice
A molecular formula tells you the exact count of each atom in a molecule. C6H12O6 is a glucose molecule, CH4 is methane, H2O is water. That is the whole definition. It does not tell you how those atoms are arranged, which is where structural formulas come in. A lot of people conflate the two, and it costs them points on exams or in lab work when they are expected to draw a structure from a molecular formula alone. You need both pieces of information separately. The standard definition is straightforward: a molecular formula gives the number and type of atoms present in one molecule of a compound. It is empirical in nature but distinct from the empirical formula, which is the simplest whole-number ratio. Sometimes the molecular formula and empirical formula are identical, like H2O or CO2. Other times they differ, like C6H12O6 versus its empirical form CH2O. Knowing which one you are dealing with matters when you are working through combustion analysis data. Let me walk you through how I actually use this in a real setting. The last time I ran into trouble was a routine mass spectrum of an unknown liquid. The molecular ion peak sat at m/z 180, and the high-resolution data suggested C9H8O4. Easy enough. But then I cross-checked with the NMR, and the proton count came out to sixteen. That mismatch should have been the first red flag. The molecular formula C9H8O4 accounts for only eight hydrogens. Either the sample was a dimer, or the instrument calibration was off, or I was looking at a hydrate form. I remeasured the sample under a different solvent condition, re-ran the MS, and found the true molecular ion at m/z 90 instead. The earlier result was a sodium adduct artifact, not the monomer. That mistake could have gone on for weeks if I had just assumed the formula was correct. Always verify the molecular ion before you commit to a molecular formula, especially when the numbers look suspiciously clean.
How to determine a molecular formula from experimental data
The usual path starts with combustion analysis. You burn a known mass of the compound, trap the CO2 and H2O, and weigh them. From those masses you back-calculate the grams of carbon and hydrogen in your original sample. Oxygen is handled by difference since combustion analyzers do not directly measure it. Once you have the mass of each element, you divide by the atomic weight to get moles, then find the simplest whole-number ratio. That gives you the empirical formula. To get the molecular formula, you need the molar mass of the compound. Multiply the empirical formula mass by the integer that brings you closest to the measured molar mass. That integer is usually found by dividing the molecular mass by the empirical mass and rounding to the nearest whole number. Here is the thing most textbooks leave out: rounding errors will wreck this process if your experimental masses are imprecise. I once had a student who got an empirical ratio of 1.33 for carbon relative to hydrogen. The instinct is to round to 1, but 1.33 is clearly four-thirds. Multiplying everything by three gave the right ratio. If you see decimals like 0.5, 0.33, 0.25, or 0.67, those are your hints. Write them down before you round. A 0.5 means multiply by two. A 0.33 means multiply by three. A 0.25 means multiply by four. A 0.67 means multiply by three. Mass spectrometry is faster for molar mass determination. Electron impact ionization gives you a clear molecular ion peak for stable compounds, and the isotope pattern can confirm the presence of halogens. Bromine gives a characteristic 1:1 M and M+2 peak ratio. Chlorine gives a 3:1 ratio. If you see those patterns, you can immediately account for the halogen mass and narrow down the remaining atomic composition. This usually cuts the determination time from a full day of wet chemistry to about forty minutes of instrument time, assuming your samples are clean and non-polymeric.
Ionic compounds do not have molecular formulas. NaCl is an empirical formula for sodium chloride, not a molecular one, because ionic substances form crystal lattices rather than discrete molecules. If someone asks for the molecular formula of table salt, the correct response is that the concept does not apply. The same is true for network solids like SiO2 and metals. Stick to molecular formulas for covalent compounds only.
Get the Full Details

Common pitfalls when working with molecular formulas
The biggest mistake I see is treating the empirical formula as the final answer. You calculate CH2O from your combustion data and stop there. The actual compound might be C6H12O6, C12H24O12, or any multiple. Without the molar mass, you cannot distinguish between them. Formaldehyde, acetic acid, and glucose all share the empirical formula CH2O. They are completely different substances with different boiling points, reactivities, and uses. Getting the molecular formula is not optional. Another issue is nitrogen-containing compounds. When you calculate oxygen by difference, any nitrogen that was not quantified will show up as an oxygen error. If your compound contains nitrogen and you only measured carbon, hydrogen, and oxygen by combustion, your oxygen value will be artificially high. Use a separate nitrogen analysis or elemental analyzer that quantifies nitrogen directly. This is especially relevant for pharmaceutical compounds where the nitrogen content can shift the formula by an entire atom. Solvent residues are another source of silent error. If your sample was dried under a hood rather than in a vacuum oven, residual ethanol or water can skew your combustion masses. I lost two days to this on a project involving a hygroscopic intermediate. The carbon percentage was consistently 1.5 percent too low across three separate runs. Switching to lyophilization before analysis fixed the problem entirely. Always dry your samples properly and report the drying method alongside your results.
When molecular formulas are not enough
A molecular formula alone cannot tell you about isomers. C2H6O could be ethanol or dimethyl ether. These have vastly different properties despite sharing the same formula. If you need to distinguish between isomers, you need spectroscopic data, not just a formula. Infrared spectroscopy will show you whether you have an O-H stretch around 3300 per centimeter or a C-O-C ether linkage instead. Nuclear magnetic resonance will tell you how many distinct hydrogen environments exist. The molecular formula gets you to the door. Spectroscopy gets you inside. For very large molecules like proteins or synthetic polymers, the concept of a single molecular formula breaks down. Proteins have sequence heterogeneity and post-translational modifications that make a fixed formula meaningless. Polymers have a distribution of chain lengths. In those cases, average molar mass values and repeat unit descriptions are more useful than trying to pin down one exact formula. Biochemists and polymer chemists switch to different notation systems for this reason. The molecular formula is a starting point, not a destination. It tells you what atoms are present and in what quantities. It does not tell you structure, bonding, reactivity, or physical properties. Use it as part of a larger analytical workflow, and you will rarely go wrong. Ignore it and assume it carries more information than it does, and you will spend a lot of time chasing explanations that the formula itself cannot provide.