Flajolet and Salvy pointed out that every Euler sum is a Q-linear combination of multiple zeta values. However, in the literature, there is no formula completely revealing this relation. In this paper, using permutations and compositions, we establish two explicit formulas for the Euler sums, and show that all the Euler sums are indeed expressible in terms of MZVs. Moreover, we apply this method to the alternating Euler sums, and show that all the alternating Euler sums are reducible to alternating MZVs. Some famous results, such as the Euler theorem, the Borwein-Borwein-Girgensohn theorems, and the Flajolet-Salvy theorems can be obtained directly from our theory. Some other special cases, such as the explicit expressions of S r m ,q , Srm ,q , S r m ,q and Srm ,q , are also presented here. The corresponding Maple programs are developed to help us compute all the sums of weight w ≤ 11 for non-alternating case and of weight w ≤ 6 for alternating case.