The chemical composition of fart gas varies with person and diet, but the following are typical volume percentages: nitrogen 59%, hydrogen 21%, carbon dioxide 9%, methane 7%, oxygen 3%. The remaining one percent is the stinky stuff, mostly hydrogen sulfide and methyl mercaptan.
That means a fart contains:
Nitrogen: 21.0 milliliters
Hydrogen: 7.5 milliliters
Carbon dioxide: 3.2 milliliters
Methane: 2.5 milliliters
Oxygen: 1.1 milliliters
Stink: 0.357 milliliters
A perfect gas at STP has a molar volume of 22.4 liters. Nitrogen, hydrogen and oxygen are all diatomic, forming molecules of N2, H2, and O2 at standard temperature and pressure.
So, in a fart, there are...
Nitrogen: 0.000938 moles
Hydrogen: 0.000335 moles
Carbon dioxide: 0.000143 moles
Oxygen: 0.000049 moles
Stink: 0.000016 moles
The molecular weights are N2 (28), H2 (2), CO2 (44), CH4 (16), O2 (32). The molecular weight of methyl mercaptan (CH3SH) is 48.1. The molecular weight of hydrogen sulfide (H2S) is 34.8.
There are several other, more exotic gases that also contribute to the odor of a fart, and some of them have quite large molecular weights. However, they are comparatively rare species, and these more exotic gases only serve to give the vintage fart a distinctive body and character. I'll assume that the mean molecular weight of the stinky stuff is 50 amu.
That means the masses of the gases in a fart are...
Nitrogen: 0.0263 grams
Hydrogen: 0.0003 grams
Carbon dioxide: 0.0063 grams
Methane: 0.0018 grams
Oxygen: 0.0016 grams
Stink: 0.0008 grams
The total mass of a fart is 0.0371 grams.
Someone else estimated that farts weigh 1.3 grams per liter. Our average fart contained 1/28th of a liter of gas, and that would work out to 0.0464 grams. That's the same ballpark as my estimate just above.
Yet another person (no bibliography will be appended to this answer) estimated that the emission speed of a fart is 3 meters per second. If that is true, then the momentum imparted by a fart is 0.00012 kg m / sec, and the kinetic energy would be 0.00018 Joules.
If an 80-kilogram person, floating around in space bare-assed, emitted a fart, the reaction would propel him in the opposite direction at a speed of 13 centimeters per day. If he kept using his farts as his only means of propulsion, he could accumulate a delta-vee of 27.6 meters per hour in one year from the recoil. (The average acceleration is 2.43E-10 m/s^2.) Of course, a lunch-wagon spaceship would have to keep him supplied with food to produce flatulence with. (And, of course, the gravitational pull of the spaceship would probably accelerate the farting flier about as much as the farts would.)
A mole contains 6.0221415E+23 particles. If the analysis so far has been correct, there are about 9.6E+20 molecules in a fart. At an emission temperature of 310.15 K, the average molecule would have an energy of 6.4E-21 J. The thermal energy of a fart, then, is 6.2 Joules, which is about 34000 times greater than the kinetic energy.
Now, how about the potential for using farts as fuel? You can get 1.420E+5 Joules per mole of H2 burned in O2, so the 0.000335 moles of hydrogen gas in a fart will yield 47.57 J. You can get 8.904E+5 Joules per mole of CH4 burned in O2, so the 0.000112 moles of methane will give us 99.72 J. The combined combustion potential energy of a fart is, therefore, 147.29 Joules. It would keep a 60-watt light bulb lit for one seconds, if the efficiency of conversion of chemical energy to electricity were 40.7%.
With this assumed conversion efficiency, it would require the farts of 6171 average people to keep a single 60-watt light bulb lit all the time. If a hundred million people were harnessed for 'round-the-clock extraction of fart gas, the "harvest" would supply about one continuous megawatt.
If an astronaut were to channel his farts into a portable rocket engine (along with the necessary amount of additional oxygen), he might be able to squeeze 1.91 m/s of delta-vee from each fart. In a day, he could change his velocity by 26.8 m/s. In a year by nearly 9.8 kilometers per second.
This raises an interesting possibility. If transfer orbit maneuvers are necessary near a body of large-asteroid size (e.g., 120 km radius), an astronaut could perhaps meet his delta-vee requirements by using the chemical potential energy of his own farts.
See Jerry's Hohmann Transfer Orbit Tutorial.
A rectal tap could be made through a special seal in his spacesuit, leading to a backpack or handheld rocket unit. The tapped fart gas could be compressed into cylinders for storage, until needed.
The total energy of a fart, kinetic and thermal and chemical potential, is 153.49 Joules, which is the same as 0.0367 kilocalories. A kilocalorie is what we mean by a "food calorie." The 14 daily farts of the average person costs him about half a food calorie. It is not, therefore, a major source of energy loss: ~ 0.02 percent of a 2500 kcal daily diet.