Octane number is the measure of the resistance of gasoline against detonation or preignition of the fuel in the engine. It is measured relative to the mixture of iso-octane (2,2,4 trimethylpentane) and n-heptane.
Higher octane fuel has a greater resistance to autoignition under higher combustion pressure and heat.
While cetane number is the measure of combustion quality of diesel oil or it is the measure of the ignition delay, the higher the cetane number of diesel the shorter the ignition delay, and the greater the fuel quality, and vice versa. A short delay affords more time for diesel fuel to burn completely.