The 28-year-old has signed a three-year deal with the Bluebirds, although the move remains subject to international clearance.
Tomlin, who scored seven goals in 42 appearances for the Robins last season, becomes Cardiff manager Neil Warnock's seventh signing of the summer.
"I'm over the moon to be at Cardiff City - absolutely buzzing to be at the club and looking forward to getting started," Tomlin told the club's website.
"I want to get back to the Premier League and I feel I can do that here. I know a lot of the lads here already which makes things even easier for me ahead of travelling down to Cornwall next week."
Warnock added: "Lee reminds me of Adel Taarabt who I had at QPR. He's always a threat when he's on the ball and you're never quite sure what he's going to do, but I'm hoping I can get the best out of him here.
"There's a lot more to come from Lee. His creativity is second to none and we want to give him the platform to use that. This is the right atmosphere for him to revel in."
Tomlin has also had spells at Bournemouth, for whom he played in the Premier League in 2015-16, as well as Middlesbrough and Peterborough United.