The transient behaviors of the swelling and deswelling of gels involve concurrent mechanical deformation and solvent diffusion and exhibit a fascinating phenomenon. In this paper, a simple numerical tool is developed by using an analogy between diffusion and heat transfer when large deformation presents for gels. Using this analogy, a finite element method is developed in the framework of a commercial finite element package ABAQUS via two material-specific user subroutines to describe the mechanical and mass diffusion behaviors of gels. The present method is not limited to any specific materials; therefore, this method can be extended to other materials that featured with coupled deformation and diffusion. This method is expected to be able to serve as a useful numerical tool to study related materials and problems due to its simplicity.