Hydrocarbons are the compound which are made from made from carbon and hydrogen.
Molecular formula- Aliphatic and aromatic are types of hydrocarbon. Hydrocarbon can be identified by their molecular formula. There are various techniques like thin layer chromatography, HPLC.
Solubility test- Hydrocarbons are not soluble in water but soluble in toluene.
Thus, By molecular formula and solubility test hydrocarbons can be identified.