Most codeine used in medicine is made by chemically converting morphine, not by extracting codeine directly from poppies. While codeine does occur naturally in the opium poppy, it’s present in such small amounts that direct extraction isn’t commercially practical. Instead, manufacturers isolate morphine from poppies first, then add a small chemical group to transform it into codeine.
Why Codeine Isn’t Simply Extracted From Poppies
Codeine is one of dozens of alkaloids found in the opium poppy (Papaver somniferum), but morphine dominates the plant’s chemistry, typically making up 45 to 90 percent of the total alkaloid content. Codeine and other minor alkaloids account for fractions of a percent. The FDA has noted that the amount of codeine extractable from opium is “too small to be of commercial importance.” So while the poppy is still the starting point for codeine production, the route is indirect: grow poppies, extract morphine, then convert that morphine into codeine in a lab.
Legal poppy cultivation for pharmaceutical use is concentrated in a handful of countries, with Turkey and Australia among the most established producers.
Extracting Morphine From the Poppy
The journey begins in the field. Poppy plants are either scored to collect raw opium latex or harvested as dried “poppy straw,” which is processed in industrial facilities. Both methods yield a complex mixture of alkaloids that need to be separated.
In a traditional extraction process described by the United Nations Office on Drugs and Crime, raw opium is dissolved and treated so that morphine and codeine form a crystalline mass of their hydrochloride salts, historically called “Gregory’s salt.” These crystals are pressed and purified through repeated rounds of dissolving, filtering through charcoal to remove color, and recrystallizing. Once the crystals are pure enough, they’re dissolved in water and treated with ammonia. Morphine precipitates out as a solid, while any naturally occurring codeine stays dissolved in the liquid. The morphine is collected, dried, and sent on for the next step.
Converting Morphine Into Codeine
The chemical difference between morphine and codeine is remarkably small. Codeine is simply morphine with one extra methyl group (a carbon atom bonded to three hydrogen atoms) attached to a specific oxygen on the molecule. This process, called O-methylation, is the core of commercial codeine manufacturing.
In practice, chemists use methylating reagents that selectively attach that methyl group to the correct spot on morphine’s structure without altering the rest of the molecule. The reaction targets a phenolic hydroxyl group, a reactive oxygen-hydrogen pair on one ring of morphine. Once the methyl group locks into place, the product is codeine. The result is a molecule with roughly one-tenth to one-twelfth the painkilling strength of morphine, which is actually a feature: codeine’s milder potency makes it useful for moderate pain and cough suppression.
After the conversion, the raw codeine is purified and then combined with an acid to form a stable salt suitable for pills and syrups. The two most common forms are codeine phosphate and codeine sulfate. From a patient’s perspective, these two salts perform identically. FDA bioavailability testing has confirmed that codeine sulfate tablets and codeine phosphate tablets deliver the same amount of active drug to the bloodstream, and the body metabolizes them at the same rate. The choice between them is a manufacturing decision, not a medical one.
Quality Standards for the Finished Product
Pharmaceutical-grade codeine must meet strict purity requirements set by organizations like the U.S. Pharmacopeia (USP). These standards limit the amount of leftover impurities from the manufacturing process. For example, one key impurity, codeine methyl ether, which can form as a byproduct during methylation, is capped at no more than 0.45 percent of the final product. Every batch is tested to confirm it falls within these limits before it reaches a pharmacy.
Making Codeine Without Poppies
Scientists have developed a completely different approach: engineering baker’s yeast to produce opioids from scratch. In a landmark proof-of-concept study, researchers at Stanford programmed yeast cells with 23 enzyme activities borrowed from plants, mammals, bacteria, and yeast itself. Fed nothing but sugar, these modified yeast cells ran through a chain of chemical transformations that mirrored what happens inside a poppy plant, converting simple amino acids step by step into complex opioid molecules including thebaine, a precursor to both codeine and morphine.
The process works by building the molecule in stages. First, the yeast converts the amino acid tyrosine into a series of increasingly complex intermediates. A key milestone is a molecule called reticuline, which sits at a biochemical crossroads. From there, additional enzymes reshape the molecule’s rings and functional groups until it reaches thebaine, which can then be converted into codeine or morphine through further enzymatic steps.
This yeast-based method currently produces tiny quantities, far below what would be needed for commercial manufacturing. But it demonstrates that codeine production doesn’t have to depend on agricultural poppy cultivation. The entire biochemical pathway, from sugar to opioid, can run inside a single-celled organism in a fermentation tank.
From Raw Material to Your Medicine Cabinet
The standard path for codeine today follows a clear sequence: poppies are grown in regulated fields, harvested, and processed to extract morphine. That morphine is chemically methylated in pharmaceutical facilities to produce codeine. The codeine is purified, converted into a salt form, tested against strict purity standards, and formulated into tablets, capsules, or liquid preparations. The entire chain, from seed to finished pill, operates under international controls overseen by bodies like the International Narcotics Control Board, which tracks legal opium production and allocation across countries.

