The invention relates to a recombinant escherichia coli, a preparation method and a method for synthesizing 3,4-dihydroxybutyric acid, and belongs to the field of biosynthesis. The recombinant escherichia coli is obtained through knocking out xylose isomerase gene xylA, 2-keto acid aldolase gene yjhH, 2-keto acid aldolase gene yagE and alcohol dehydrogenase gene in escherichia coli, overexpressing xylose dehydrogenase gene and/or 2-keto acid decarboxylase gene, and overexpressing aldehyde dehydrogenases gene. By taking xylose as a basic substrate, a compound substrate can be formed by adding glucose and/or glycerinum on the basis of the xylose, and the 3,4-dihydroxybutyric acid is biologically synthesized through the recombinant escherichia coli; by-products are extremely less, and the formation of the by-products can be interdicted through passage metabolism optimization. The recombinant escherichia coli, the preparation method and the method for synthesizing the 3,4-dihydroxybutyric acid have the advantages that the preparation method is simple, the production cycle is short, the cost is low, later continuous optimizing and transformation are realized, and the good industrial development and application prospect is realized.