If added to the 40-man roster, Hammel would get a one-year contract with a $1.5 million salary in the major leagues and the chance to earn performance bonuses.
Texas announced the deal Friday, three months after the Kansas City Royals declined a $12 million mutual option and instead paid a $2 million buyout.
Hammel was 4-14 with a 6.02 ERA in 18 starts and 21 relief appearances last season, dropped from the rotation in early July after losing six starts in a row. The 14 losses were a career high.
He is 96-114 with a 4.62 ERA while starting 298 of his 377 games over 13 big league seasons for six teams. He was 15-10 in 2016 for the World Series champion Chicago Cubs, but went 12-27 the past two years with the Royals.
The Rangers also agreed to a minor league deal with Matt Davidson, league sources told ESPN's Jeff Passan.
Along with being an infielder, Davidson could be used to pitch as well. The 27-year-old hit .228 with 20 home runs for the Chicago White Sox last season and threw three scoreless innings in relief appearances.
The Associated Press contributed to this report.