The sides agreed to terms early last week, pending a physical.
The 29-year-old Hernandez had spent his entire professional career in the Philadelphia Phillies organization, but they declined to offer him a 2020 contract in his third year of arbitration eligibility. The switch-hitter batted .279 with 14 home runs and 71 RBI last season. He has played in 161 games each of the past two years.
The Indians were in the market for a second baseman after not picking up veteran Jason Kipnis' contract option for 2020.
Hernandez is a .277 career hitter with 46 homers in seven major league seasons. To make room for him on the roster, catcher Eric Haase was designated for assignment.