We describe a completely in vitro high-throughput screening system for directed evolution of enzymes based on in vitro compartmentalization (IVC). Single genes are transcribed and translated inside the aqueous droplets of a water-in-oil emulsion. Enzyme activity generates a fluorescent product and, after conversion into a water-in-oil-in-water double emulsion, fluorescent droplets are sorted using a fluorescence-activated cell sorter (FACS). Earlier in vivo studies have demonstrated that Ebg, a protein of unknown function, can evolve to allow Escherichia coli lacking the lacZ beta-galactosiclase gene to grow on lactose. Here we demonstrate that we can evolve Ebg into an enzyme with significant P-galactosidase activity in vitro. Only two specific mutations were ever seen to provide this improvement in Ebg P-galactosidase activity in vivo. In contrast, nearly all the improved beta-galactosidases selected in vitro resulted from different mutations.