By using the variational approach, we have studied the strange, charmed and beauty baryons masses. The considered potential is Coulomb as well as linear confining terms and the spin--isospin dependent potential is regarded as a perturbation, too. Some numerical results are given for spectra of heavy baryons and compared with experiments or other works.