A gallon of ethanol contains approx. 80,000 BTUs. A gallon of unleaded regular contains about 119,000 BTUs. As a result, a standard barrel (42 gallons) of ethanol is worth about 28 gallons of gasoline.
Octane in gasoline is not a measurement of energy, but is a measurement of resistance to pre-ignition. Gasoline is made up of HC (Hydrocarbon) molecule chains and those HC chains having 7 carbon atoms are called Heptane and those that have 8 carbon atoms are called Octane. Gasoline fuel rated @ 87 Octane contains 13% Heptane HC chains and 87% Octane HC chains.
Some information on different fuels.
http://www.eere.energy.gov/afdc/pdfs/fueltable.pdf