Peralta, 31, is a two-time All-Star and .268 career hitter with 156 home runs in 11 seasons with Cleveland and Detroit. He missed 50 games late last season in conjunction with his involvement in Major League Baseball's Biogenesis scandal.
Peralta's signing will be the second significant move this week for Cardinals general manager John Mozeliak, who acquired outfielder Peter Bourjos from the Angels on Friday in a four-player trade that sent third baseman David Freese to Los Angeles.
The Cardinals expect to slot Peralta in at shortstop in place of Pete Kozma next season. Matt Carpenter will move from second base to third and rookie Kolten Wong will play second in a reconfigured infield for the National League champions.
The Cardinals were intent on upgrading the shortstop position after Kozma hit .217 with a .548 OPS this season. But most of the speculation had focused on Texas shortstops Elvis Andrus and Jurickson Profar and free agent Stephen Drew as potential targets for St. Louis.
Although Peralta has limited range at shortstop, he's sure-handed in the field and has a career defensive Wins Above Replacement of plus-4.6, according to Baseball-reference.com. Peralta played some left field for Detroit in the postseason after returning from his suspension, and several clubs reportedly had expressed interest in him as an outfielder.
Since Peralta did not receive a qualifying offer from Detroit, the Cardinals will not have to surrender a draft pick in exchange for signing him.
Peralta had reportedly been seeking a four-year deal for more than $50 million. Terms of his deal with the Cardinals weren't immediately available.