Williams was recruited to play college basketball at the University of Illinois for the 2002–03 NCAA season by Bill Self. In his freshman year, he started 30 of 32 games and ranked third in the Big Ten Conference in assists with 4.53 per game.
Bruce Weber assumed the head coach position for the Illini in April 2003 and helped develop Williams throughout his remaining collegiate career. As a sophomore, Williams improved his scoring average from 6.3 to 14.0 points per game and improved his assists per game from the prior year to 6.17. Williams was a First-Team All-Big Ten selection by both the coaches and media.
In 2005, as a junior starting point guard, Williams led the Fighting Illini to the NCAA championship game where they lost to the University of North Carolina. That season saw the Illini go undefeated until the final game of the regular season when they lost to Ohio State by one point. Illinois’s road to the Final Four was marked by a comeback win over the Arizona Wildcats, where the Illini, led by Williams, came back from fifteen points down in the final minutes to win the game. Williams made the game-tying three-point shot with just 38.5 seconds left in regulation. He then hit the go-ahead three-pointer in overtime, and the Illini never looked back in that game.
Williams received many awards after the 2004–05 season. Those honors include being named a consensus Second Team All American, as well as being named First Team All-Big Ten, Big Ten All-Tournament Team, and All-Final Four team and at the conclusion of the academic year, Williams was named as the University of Illinois Athlete of the Year. Williams was also a finalist for the Wooden Award and was named Most Outstanding Player of the Chicago Regional in the NCAA Tournament. Williams was named First-Team All-Big Ten as a sophomore in 2004 and as a junior in 2005, the year in which Williams, called by coach Bruce Weber “the MVP of the team”, led the Illini to the Final Four. The team included four other future NBA players, including Dee Brown, Roger Powell, James Augustine, and Luther Head.
Williams declared for the NBA draft after the 2005 season, forgoing his final year of collegiate eligibility.