First we have to go back to the chemical equations, and this time, include the standard enthalpy of combustion.
Hydrogen: 2 H$_2$ + O$_2$ → 2 H$_2$O + 572 kJ/mol
Methane: CH$_4$ + 2 O$_2$ → CO$_2$ + 2 H$_2$O + 889 kJ/mol
Dodecane: 2 C$_{12}$H$_{26}$ + 37 O$_2$ → 24 CO$_2$ + 26 H$_2$O + 15,026 kJ/mol
Ethanol: C$_2$H$_5$OH + 3 O$_2$ → 2 CO$_2$ + 3 H$_2$O + 1371 kJ/mol
Ammonia: 4 NH$_3$ + 3 O$_2$ → 2 N$_2$ + 6 H$_2$O + 1267 kJ/mol
Carbon 1: C + O$_2$ → CO$_2$ + 394 kJ/mol
Carbon 2: 2 C + O$_2$ → 2 CO + 567 kJ/mol
And I'll just add the values for atomic weights that I'm using. These are in grams per mole. I got them off Wikipedia's Periodic Table, the big one.
H: 1.008
C: 12.011
N: 14.007
O: 15.999
From this we can calculate the energy-density by getting the mass-per-mole of one side of the equation (doesn't matter which side, since the equations are balanced), and the heat energy per mole from the end of the equation. Divide energy per mole by mass per mole and you will get the energy density.
For example, hydrogen. 4*1.008 + 2*15.999 = 36.03. 572/36.03 = 15.876 kJ/g which is equivalent to 15.876 MJ/kg.
I decided to do this for both with and without O$_2$, to see them side by side.
Fuel $\hspace{2.0cm}$ without O$_2$ $\hspace{1.7cm}$ with O$_2$
Hydrogen $\hspace{1cm}$ 141.865 MJ/kg $\hspace{1cm}$ 15.876 MJ/kg
Methane $\hspace{1.2cm}$ 55.414 MJ/kg $\hspace{1.2cm}$ 11.107 MJ/kg
Dodecane $\hspace{0.9cm}$ 44.106 MJ/kg $\hspace{1.3cm}$ 9.856 MJ/kg
Ethanol $\hspace{1.4cm}$ 29.760 MJ/kg $\hspace{1.25cm}$ 9.651 MJ/kg
Ammonia $\hspace{1.05cm}$ 21.456 MJ/kg $\hspace{1.25cm}$ 8.172 MJ/kg
Carbon 1 $\hspace{1.1cm}$ 32.803 MJ/kg $\hspace{1.25cm}$ 8.953 MJ/kg
Carbon 2 $\hspace{1.1cm}$ 23.603 MJ/kg $\hspace{1.2cm}$ 10.121 MJ/kg
(P.S., these are the higher-heating values (HHV). The lower-heating values exclude energy carried away by vaporized water. I think for rocket engines, we want HHV because that carried away water still plays a role imparting an impulse to our vehicle, via Newton's 3rd law.)
There are some interesting things about this. First thing I noticed was that Hydrogen is really not all that it's cracked up to be. When including the mass of the O2, the drop away from hydrogen is not all that significant compared to the usual MJ/kg figures we're used to. Ammonia + O2 still has over 50% as much energy as hydrogen + O2!
Second thing I noticed was ethanol vs dodecane. Dodecane is basically the highly pure kerosene used in RP-1 (the Russian version is called T-1 I think). But with oxidizer mass included, ethanol and dodecane are almost exactly equal! Maybe von Braun was not so primitive to use ethanol in his V2 after all?
Third thing, and this one really blew me away. Look at Carbon equation 2. That's the one that produces carbon monoxide instead of carbon dioxide. (Carbon monoxide is produced when there is "insufficient" oxygen.) Guess what. Burning it this way produces more energy! You just have to take into account the mass of all reactants, like rocket engineers should. This result is so surprising that I confess I'm pretty suspicious of it. I will look for a corroborating source ot make sure I got the combustion enthalpy correct. If it's true, then well if only we could get pure carbon solid fuel working in a rocket engine... It would even beat kerosene by a little bit!
I know this is not the whole story, so it won't explain everything. Volumetric density, toxicity, temperature (cryogenic!), solid residue like soot that can wreck your turbopump... I'm sure there are other factors too. But I hope you will at least agree that this sort of calculation, taking the mass of the O2 into account, absolutely had to be done for rocket engines. Rockets carry the oxidizer with them, after all. The results are interesting.