And #"empirical"# actually means #"experimental"#. And thus you take a known mass of hydrocarbon, combust it in a furnace, and the volumes of carbon dioxide and water that are evolved in the combustion may be accurately measured. [See here.](https://socratic.org/questions/what-is-empirical-formula?source=search) And from the #%C#, #%H#, #%N# figures we can get an #"empirical formula"#, and given a measurement of molecular weight, we can calculate a #"molecular formula."#
See here for another example. See here for the process of combustion.