The 28-year-old's contract at Crystal Palace expires on July 1.
The club's football director Andrew Neville said: "Neil is a player that has drawn a lot of interest due to his performances in recent seasons, so we're delighted he has chosen Leicester City for the next stage of his career.
"Sven and his staff were very impressed with him last season and his quality and versatility will add considerable strength to the squad."
Scottish champions Rangers had been keen to sign Danns, who made a total of 49 appearances for Palace last season and scored nine goals.
He began his career as a trainee at Blackburn and signed for Colchester for a nominal fee in December 2004. Birmingham paid ?500,000 to take him to St Andrew's in 2006 and he moved on to Palace in January 2008 for ?600,000.
Source: Team Talk
Source: Team Talk