We construct a general parametrization of the baryon octet and decuplet mass operators including the three-body terms using the unit operator and the symmetry-breaking factors Md = diag(0, 1, 0) and Ms = diag(0, 0, 1) in conjunction with the spin operators. Our parametrization has the minimal number of operators needed to describe all the octet and decuplet masses. Investigating the likely size of the three-body terms, we find that contributions of the three-body hypercharge splittings are comparable to those from the one- and two-body isospin splittings and that contributions of the three-body isospin splitting operators are very small. We prove that, in dynamical calculations, one must go to three loops to get the three-body terms. We also find that the suggested hierarchy of sizes for terms in the most general expression for baryon masses that involve multiple factors of Md and/or Ms does not hold strictly for dynamical calculations in heavy-baryon chiral perturbation theory: terms of a given order in a meson loop expansion may appear both with the expected factors of Md and Ms, and with one factor more.