On the basis of incompressible viscid magnetohydrodynamic equations, a formula is developed to study the mitigation of viscosity on the Rayleigh-Taylor instability in Z pinches. The results indicate that in the whole wavenumber region, the viscosity effect can mitigate the instability. In addition, we compare the viscosity effect with the finite Larmor radius effect [Chin. Phys. Lett. 19 (2002) 217], and the calculation results show that in the temperature region of interest, the former is stronger than the latter. Moreover, for heavy wire-array implosion the viscosity effect is stronger than the finite Larmor radius one, because the former is proportional to mi1/2 and the latter is independent of mi.