The deal, subject to international clearance, sees Ojo becomes Cardiff’s third summer signing following the arrival of Wales striker Kieffer Moore from Wigan and Arsenal loanee Jordi Osei-Tutu.
“I’ve got a point to prove and I’m really excited for the new challenge,” Ojo, 23, told Cardiff City TV.
“Cardiff City is a massive club with great fans and great players – hopefully I can show what I can do here and fit right in.
“I’m delighted to get here in time for a full week’s training with the team ahead of the first home game this Saturday. Now it’s important that we start right.”
Ojo, who can play out wide in attack or in a number-10 role, has made 13 appearances for Liverpool and spent time on loan at Fulham, Rangers, Reims, Wigan and Wolves.
Cardiff start their Sky Bet Championship campaign against Sheffield Wednesday on Saturday.
The Bluebirds later announced that defender Curtis Nelson has signed a two-year extension to his current contract, keeping him at the club until the summer of 2023.
The 27-year-old told Cardiff City TV: “I’ve got three great centre-backs to learn from here, in Sol (Bamba), Flinty (Aden Flint) and Moz (Sean Morrison). I’m just looking to keep learning and performing.”