Asked by: Katrina Parker, Durham
Caffeine is dissolved from the beans after they have been softened in hot water or steam, using either a powerful solvent such as methylene chloride or ethyl acetate, or a gentler solvent such as water itself. All of these solvents (especially the first two) remove some of the flavour molecules as well as the caffeine, though, so the trick is to find a way of putting these back.
One way is to perform a first extraction with water, then shake up the water with a small volume of methylene chloride, or to pass it through a charcoal filter. Both of these processes selectively remove the caffeine from the water, but leave most of the flavour molecules. The leftover water is then added back to the treated beans for re-absorption of the flavours.
A more expensive alternative is to use 'supercritical' liquid carbon dioxide as the solvent, since this dissolves the small caffeine molecules but leaves the larger flavour molecules in the beans.
Subscribe to BBC Focus magazine for fascinating new Q&As every month and follow @sciencefocusQA on Twitter for your daily dose of fun science facts.