Mr. Karim, who is 27, became visibly uncomfortable when the subject turned to money, and he would not say what he stands to make when Google’s purchase of YouTube is completed. He said only that he is one of the company’s largest individual shareholders, though he owns less of the company than his two partners, whose stakes in the company are likely to be worth hundreds of millions of dollars, according to some estimates. The deal was so enormous, he says, that his share was still plenty big.

“The sheer size of the acquisition almost makes the details irrelevant,” Mr. Karim said.

On Wednesday, during a walk across campus and a visit to his dorm room and the computer sciences building where he takes classes, Mr. Karim described himself as a nerd who gets excited about learning. Nothing in his understated demeanor suggests he is anything other than an ordinary graduate student, and he attracted little attention on campus in jeans, a blue polo shirt, a tan jacket and black Puma sneakers.

Mr. Karim said he might keep a hand in entrepreneurship, and he dreams of having an impact on the way people use the Internet — something he has already done. Philanthropy may have some appeal, down the road. But mostly he just wants to be a professor. He said he simply hopes to follow in the footsteps of other Stanford academics who struck it rich in Silicon Valley and went back to teaching.

“There’s a few billionaires in that building,” he said, standing in front of the William Gates Computer Science Building. But his chosen path will not preclude another stint at a start-up. “If I see another opportunity like YouTube, I can always do that,” he said.

David L. Dill, a professor of computer science at Stanford, said Mr. Karim’s choice was unusual.

“I’m impressed that given his success in business he decided to do the master’s program here,” Mr. Dill said. “The tradition here has been in the other direction,” he said, pointing to the founders of Google and Yahoo, who left Stanford for the business world.