The former Croatia international, 31, was most recently with New York Cosmos and becomes the Ibrox club's sixth new addition ahead of the new season.
Kranjcar follows the arrivals of Joey Barton, Matt Crooks, Clint Hill, Jordan Rossiter and Josh Windass as Rangers prepare for their return to the Scottish Premiership.
The club's statement read: "Kranjcar is a vastly experienced, technically-gifted player who has enjoyed a top-level career spanning 15 years. He will undoubtedly be an important and exciting addition to Mark Warburton's squad."
Kranjcar told Rangers TV: "It is great. Obviously it is a big honour and a privilege to sign for a club this size, but it's also a big responsibility in my opinion because you have to be the best you can.
"You have to win trophies and it is something I am really looking forward to."
Boss Warburton added: "We are delighted to secure a player of Niko's undoubted qualities and very much look forward to welcoming him to the club.
"Such a signing shows our desire to achieve a positive balance between young, hungry players and the undoubted necessity of experience and maturity."
Rangers won promotion to the Scottish Premiership in 2015-16, ending a four-year spell outside of the top flight.