Lin sent his résumé and a DVD of highlights of his high school basketball career to all of the Ivy League schools; the University of California, Berkeley; and his dream schools, Stanford University and the University of California, Los Angeles (UCLA). The Pac-10 (now Pac-12) schools wanted him to walk on rather than be actively recruited or offered an athletic scholarship. Harvard and Brown were the only teams that guaranteed him a spot on their teams, but Ivy League schools do not offer sports scholarships. University of San Francisco men's basketball coach and retired NBA player Rex Walters said NCAA limits on coaches' recruiting visits had reduced Lin's chances: "Most colleges start recruiting a guy in the first five minutes they see him because he runs really fast, jumps really high, does the quick, easy thing to evaluate".
Harvard assistant coach Bill Holden was initially unimpressed with Lin's on-court abilities and told Lin's high school basketball coach, Peter Diepenbrock, that Lin was a "Division III player". Later Holden saw Lin playing in a much more competitive game, driving to the basket at every opportunity with the "instincts of a killer", and he became Harvard's top recruit. Its coaches feared that Stanford—across the street from his high school—would offer Lin a scholarship, but it did not, and Lin chose to attend Harvard. Golden State Warriors owner and Stanford booster Joe Lacob said Stanford's failure to recruit Lin "was really stupid. The kid was right across the street. [If] you can't recognize that, you've got a problem". Kerry Keating, a UCLA assistant who had offered Lin the opportunity to walk on, said in hindsight that Lin would probably have become a starting point guard for UCLA.
A Harvard coach remembered Lin in his freshman season as "the [physically] weakest guy on the team", but in his sophomore season (2007–08), Lin averaged 12.6 points and was named to the All-Ivy League Second Team. By his junior year during the 2008–09 season, he was the only NCAA Division I men's basketball player ranked in the top ten in his conference for scoring (17.8), rebounding (5.5), assists (4.3), steals (2.4), blocked shots (0.6), field goal percentage (0.502), free throw percentage (0.744), and three-point shot percentage (0.400), and was a consensus selection for the All-Ivy League First Team. He had 27 points, 6 rebounds, and 8 assists in an 82–70 win over the 17th-ranked Boston College Eagles, three days after the Eagles defeated No. 1 North Carolina.
In his senior year (2009–10), Lin averaged 16.4 points, 4.4 rebounds, 4.5 assists, 2.4 steals, and 1.1 blocks, and was again a unanimous selection for the All-Ivy League First Team. He was one of 30 midseason candidates for the John R. Wooden Award and one of 11 finalists for the Bob Cousy Award. He was also invited to the Portsmouth Invitational Tournament. Fran Fraschilla of ESPN named Lin one of the 12 most versatile players in college basketball. Lin gained national attention for his performance against the 12th-ranked Connecticut Huskies, when he scored a career-high 30 points and grabbed 9 rebounds on the road. After the game, Hall of Fame Connecticut coach Jim Calhoun said of Lin: "I've seen a lot of teams come through here, and he could play for any of them. He's got great, great composure on the court. He knows how to play."
For the season, Harvard set numerous program records including wins (21), non-conference wins (11), home wins (11) and road/neutral wins (10). Lin finished his career as the first player in the history of the Ivy League to record at least 1,450 points (1,483), 450 rebounds (487), 400 assists (406) and 200 steals (225). He graduated from Harvard in 2010 with a degree in economics and a 3.1 grade-point average.