The goal of in vitro compartmentalization (IVC) is to divide a large reaction between many microscopic compartments. This technique was first developed to generate 'artificial cells' for the directed evolution of proteins (Fig. 1). Typically, an aqueous solution of genes and an in vitro transcription-translation system is stirred (or homogenized) into an oil-surfactant mixture to create a water-in-oil (w/o) emulsion with ∼1010 aqueous droplets per ml of emulsion. The majority of droplets contain no more than a single gene along with all of the molecular machinery needed to express that gene. The expressed proteins and the products of their catalytic activities cannot leave the droplets, and so genotype is coupled to phenotype in vitro, making it possible to select very large libraries of genes (1081011 genes). We describe the advantages and applications of IVC in Box 1. Here we present a protocol for performing a directed evolution experiment by IVC that makes use of one or more w/o emulsions. This procedure involves the generation of a gene library, the performance of a selection, and the subsequent recovery of the selected genes by PCR. We also describe two procedures for converting w/o emulsions to water-in-oil-in-water (w/o/w) emulsions for high-throughput screening using a fluorescence-activated cell sorter (FACS; Box 2 and Fig. 2, and Box 3). Finally, we describe two methods for delivering substrates, regulators and other compounds to the preformed aqueous droplets of a w/o emulsion (Box 4). © 2006 Nature Publishing Group.