Lepton and quark flavor invariants are studied, both in the Standard Model with a dimension five Majorana neutrino mass operator, and in the seesaw model. The ring of invariants in the lepton sector is highly non-trivial, with non-linear relations among the basic invariants. The invariants are classified for the Standard Model with two and three generations, and for the seesaw model with two generations, and the Hilbert series is computed. The seesaw model with three generations proved computationally too difficult for a complete solution. We give an invariant definition of the CP -violating angle θ in the electroweak sector.