The terms of the transfer are not officially known but its thought to be worth an initial £500,000 with a £100,000 add on if City are promoted.
Barker passed his medical and completed the move this morning.
Last season Barker played 42 games for Barnsley and in his career has played 130 games for the Tykes. He was voted young player of the year in 2000 and 2001.
He is still only 22.
Welcome to Ninian Park.
Barnsley boss Steve Parkin told the Barnsley Official Website
"We received a substantial offer for Chris from Cardiff and in the present financial climate around the game it is an offer that the club could not turn down because of the lack of television money and the disappointment of relegation.
“I think that everybody around the club was aware that we would have to cash in on somebody at some stage and they have come in with a good offer for him.
“I have been expecting a phone call for a while. Chris is young, athletic but he got very tired towards the end of last season because he had played a lot of games.
“He openly admitted himself that he had played a lot of games on the bounce but he came back fit and looked sharp so I can see why Cardiff would be interested in him.
“I am disappointed to see Chris go. I do not think that any manager should be pleased to see any of his players leave if he thinks something about them.
“The only good thing is that we got the right price for him and we were compensated for our efforts with him and I wish him well. He is a great lad - I hope that he does not play too well against us and whoever plays up against him is on form for that game”.