Indigo plants have been used to dye fabric for thousands of years. Unlike other dyes, indigo does not end up chemically linked to textile fibers; rather, it adsorbs to the surface of the threads. This allows the fibers' white cores to show through to various degrees after abrasion. Hence that impossible-to-replicate look of perfectly worn-in jeans.

But indigo plants yield only a small amount of the dye. It's not nearly enough to keep pace with the enormous demand that Levi Strauss unleashed when he invented blue jeans in the 1870s. Now, after over a century of relying on a lot of toxic chemicals to make a synthetic version, researchers have engineered bacteria that will make it.

The demand for blue dye was handled by one of Strauss’ fellow Bavarians—Adolph von Baeyer, of aspirin fame. He found a way to make a synthetic version of indigo, for which he won the Nobel Prize in Chemistry in 1905.

But the industrial process currently used to synthesize indigo is bad for the environment. The raw material used to make it is the petroleum product benzene (Baeyer studied under Kekulé, who first figured out the structure of benzene). Benzene is toxic, flammable, volatile, carcinogenic, and neurotoxic.

And the problems don't end there. After treating benzene with formaldehyde, hydrogen cyanide, and other noxious chemicals, we get indigo. It's insoluble in water and thus must be treated with a corrosive reducing agent to become an active dye. Finally, the wastewater from most dye mills ends up in rivers because treating it is such a hassle.

Researchers at UC Berkeley—just across the bay from where Strauss made his first jeans—have found a more sustainable way. Genetically engineered bacteria had already been harnessed to replace chemical synthesis of indigo; but this new work has also managed to avoid using the hazardous reducing agents needed to render the dye active. Results are reported in Nature Chemical Biology.

Instead of using the enzyme from the indigo plants traditionally grown in plantations throughout India, Europe, and the Americas, these fashion-forward bioengineers used the one in the Japanese indigo plant, which provides a higher yield. The enzyme uses an amino acid (tryptophan) as its starting material and generates a precursor to indigo, which it then holds in a protected, inactive state by linking it to a sugar molecule.

To activate the enzyme, the glucose has to be removed either enzymatically or by treatment with acid. This is a commercial challenge, the authors admit, but is less toxic than the current reliance on reducing agents.

They put this gene into E. coli and grew the bugs overnight in flasks. The glucose-protected indigo precursor conveniently gets secreted into the broth, so they don’t even have to purify it out of the bacteria—they just dunked denim swatches right into the growth media. Even after laundering, the fabric stayed blue.