Ellis, an 11-year MLB veteran, batted .264 over his last two seasons with the Los Angeles Dodgers and has been was one of the steadiest fielders in the major leagues.
The 36-year-old, who played his first nine seasons with the Oakland Athletics, is a career .265 hitter with 105 home runs, 538 RBIs and a .330 on-base percentage.
Terms of the deal weren't immediately available. Ellis made $5.25 million with the Dodgers last season.
The St. Louis Post-Dispatch earlier reported the pending deal.
Ellis will give the Cardinals a reliable glove. He is listed as a plus-12 in Baseball Info Solutions' runs-saved rankings. Boston's Dustin Dustin Pedroia, with a plus-15, was the only second baseman to finish with a higher ranking.
The Cardinals are hoping that rookie Kolten Wong can take over as their regular second baseman in 2014. But Wong hit only .153 (9-for-59) after an August callup to the big-league club, and the addition of Ellis gives the Cardinals the luxury of breaking him in slowly. Wong bats from the left side and Ellis from the right, so they also give manager Mike Matheny additional flexibility at the position.
ESPN.com senior writer Jerry Crasnick contributed to this report.