The diagonalization of general mass matrices is a more delicate proble
m when eigenvalue degeneracies exist. In this case, often overlooked i
n the literature, some difficulties arise related to the freedom in th
e choice of basis in degenerate subspaces. Here two simple algorithms
are developed to deal with quark and neutrino mass matrices with arbit
rary degeneracies.