The balance, folded into the gas law
Two definitions meet here. Density is mass per volume, — is the Greek letter rho, said “row”, and for a gas it is usually quoted in grams per litre. Molar mass is mass per mole, , in grams per mole. Put into , divide through by , and the mass turns into a density on its own:
— read aloud rho equals P M over R T. Four letters, four jobs: is the gas's density in g/L, its absolute pressure in kPa, its molar mass in g/mol, and the absolute temperature in kelvin, with refereeing as always. Solved the other way, , it becomes the classic identification: weigh a known volume of an unknown gas, and its molar mass — and usually its name — falls out.
Two sanity rails worth carrying. Heavy molecules make dense gases at the same conditions, because is directly proportional to . And hot gas is thin gas: sits underneath, which is the entire operating principle of a hot-air balloon. If your answer says otherwise, something upstream is inverted.