The invention discloses a method for extracting chenodeoxycholic acid and allocholic acid from duck bile, and belongs to the technical field of biological engineering. The method comprises the following steps of (1) preparing of bile acid extracting liquid: obtaining duck bile, saponifying, cooling, adjusting a pH (potential of hydrogen) value to 7 to 8, adding a mixed solvent of ester and alkane, adjusting the pH value to 2 to 4, extracting, and discoloring, so as to obtain the bile acid extracting liquid; (2) preparing of bile acid magnesium salt: adjusting the pH value of the bile acid extracting liquid in step (1) to 4.5 to 5.5, dissolving the magnesium salt, adding into the bile acid extracting liquid, refluxing, cooling, and separating, so as to respectively obtain the magnesium allocholate and a chenodeoxycholic acid solution; refining and purifying the chenodeoxycholic acid solution, so as to obtain a finished product of henodeoxycholic acid; (3) extracting of the allocholic acid: adding water and carbonate into the prepared magnesium allocholate in step (2), heating and dissolving, separating solid from liquid, adjusting the pH value of a solution to 1 to 2, and separating solid from liquid, so as to obtain a finished product of the allocholic acid. The method has the advantages that the purities and extracting rates of the chenodeoxycholic acid and the allocholic acid are greatly improved, the operation is safe, and the method is suitable for industrialization.