The 31-year-old joins former QPR team-mates Joey Barton and Clint Hill at Ibrox as he becomes Mark Warburton's sixth summer signing.
Kranjcar, capped 81 times for his country, was a free agent following a spell with New York Cosmos.
"We are delighted to secure a player of Niko's undoubted qualities," said manager Warburton.
"Such a signing shows our desire to achieve a positive balance between young, hungry players and the undoubted necessity of experience and maturity.
"In addition, I would like to thank the Cosmos for the highly professional manner in which they have conducted their business throughout this process. It has been a pleasure to deal with them."
Kranjcar, who has not represented Croatia since 2013, had only been with Cosmos since March after being released by Dynamo Kiev.
He revealed a three-hour dinner with Warburton in New York last month convinced him that coming to Scotland was the right move.
"It was probably the most important thing," Kranjcar said. "We had a great, great talk where I found out how much I really wanted this deal to happen.
"That was my first question - I hope the goal is to win the league.
"I believe a club the size of Rangers, whatever situation it is in or was in the previous years, has to fight to win the league and to win it.
"That is something you want to achieve when you come to a club the size of Rangers, you want to win the league and you want to fight for every title."
Kranjcar previously had spells at Portsmouth, Tottenham and QPR in England after starting his career at Dinamo Zagreb in his native Croatia and then moving to Hajduk Split.
As well as Barton and Hill, he joins ex-Liverpool youngster Jordan Rossiter and former Accrington duo Josh Windass and Matt Crooks as new arrivals at Ibrox.
Former Burnley goalkeeper Matt Gilks could be the next, while Warburton is also looking for more cover at full-back and up front.
"With his passing, creativity and top-level experience, a fully-fit and match sharp Kranjcar would be an asset to Rangers but where does he fit into the side?
"He has never been a winger, even if he was often posted out wide during his spells at Portsmouth and Tottenham. By nature and talent, he is a classic number 10, a player to sit in the hole behind a main striker and orchestrate attacks without being concerned about defensive duties.
"Rangers manager Mark Warburton has always tended to play 4-3-3 with a sitting midfielder, so Kranjcar would need to play in one of the advanced central midfield roles."
Read more: 'Kranjcar can shine if rust is overcome'
Find all the latest football transfers on our dedicated page.
Croatia midfielder Niko Kranjcar has signed for Rangers on a two-year deal after completing a medical.