Gasoline, a refined product of crude oil, does not have a single chemical formula as it is a mixture of over 500 hydrocarbons and other compounds. These hydrocarbons typically have five to 12 carbon atoms per chain.
Gasoline contains between 30 and 50 percent heptane and isooctane, which feature seven and eight carbon atoms, respectively. The percentage ratio between these two hydrocarbons determines the octane number of gasoline; thus, gasoline with an octane rating of 87 contains approximately 87 percent isooctane and 13 percent heptane. The latter can damage internal combustion engines in sufficient quantities and make an audible knocking sound when combusted.