Mr. Williams' first significant film role was in - and as - Popeye in Robert Altman's 1980 musical about the spinach-chugging, lovestruck comic-strip sailor. A commercial flop, the film nonetheless showed Mr. Williams' range, and his willingness to try the odd, the counterintuitive - and to break into song. He had the title role, too, in 1982's The World According to Garp, an adaptation of John Irving's novel about wrestling, sex, and death. Mr. Williams was nominated for a best actor Golden Globe for his portrayal of a Russian saxophonist trying to make his way in America in Paul Mazursky's Moscow on the Hudson (1984). Mr. Williams received his second Golden Globe acting nod - and his first Academy Award nomination - for his motormouthed performance as real-life Armed Forces Radio DJ Adrian Cronauer in Barry Levinson's war comedy Good Morning, Vietnam (1987).
In 1989, Mr. Williams moved away from straight-out laughs to take a stab as an inspirational prep school English teacher - invoking Walt Whitman and Robert Frost - in the coming-of-age drama Dead Poets Society. Mr. Williams received a best actor Oscar nomination for his Mr. Chips-like turn. More recognition from the Academy came with a supporting actor nomination for his performance as a troubled, truth-telling homeless man opposite Jeff Bridges in The Fisher King (1991). Mr. Williams was the crazy wish-granting genie in Disney's animated megahit Aladdin (1992), a role designed for the comic star - and a role instrumental in establishing the importance of A-list voice actor casting. He was the crazy cross-dressing nanny in the fractured fam-com Mrs. Doubtfire (1993).
And in 1997's Good Will Hunting - nominated for nine Academy Awards - he played the earnest therapist pushing Matt Damon's title character to fulfill his potential. Mr. Williams fulfilled his, winning the best supporting actor Oscar.
Mr. Williams' sizable filmography is, fittingly, an up-and-down, haywire thing: near-great films alongside near-schlock. When he went for the "serious" roles - most memorably as a creepy shopping-mart snapshot developer in the psycho-thriller One Hour Photo (2002) - it took audiences a few minutes to adjust. And he was a sucker for sap: Jack (1996), from Francis Ford Coppola, and Patch Adams (1998) were Mr. Williams at his mushiest.
Mr. Williams was born on July 21, 1951, in Chicago and raised in the tony suburbs of Detroit, and then in Northern California. His father was an executive at Ford Motor Co., his mother had been a model. Mr. Williams took an interest in theater in high school and never stopped. He was one of only 20 students accepted into the 1973 freshman class at Juilliard, the fabled New York drama school. One of his classmates - and dear friends until his untimely death - was the future Superman, Christopher Reeve. In 1988, Mr. Williams joined his fellow "wild and crazy guy," Steve Martin, in an acclaimed Off-Broadway production of Samuel Beckett's existential farce, Waiting for Godot.
Mr. Williams, an avid cyclist who befriended Lance Armstrong and tagged along on many a Tour de France, could always be counted on to throw late-night talk show hosts - Leno, Letterman, Stewart, Conan - into helpless paroxysms of laughter. His impressions of John Wayne, Christopher Walken, Peter Lorre, Jack Nicholson, Carol Channing, and, most recently, of Siri, the i-Phone goddess, were as inspired as they were insane. A trove of Mr. Williams' riffs can be found across the YouTube universe.
Long plagued by alcohol and substance abuse issues, Mr. Williams was married three times. In 1978, he wed Valerie Velardi, a dancer. They had a son before divorcing. In 1989, he married Marsha Garces, who was his son's nanny. They had two children. Garces filed for divorce in 2008. In 2011, he married Susan Schneider, a Bay Area graphic designer.
"This morning, I lost my husband and my best friend, while the world lost one of its most beloved artists and beautiful human beings. I am utterly heartbroken," Schneider said in a statement. "On behalf of Robin's family, we are asking for privacy during our time of profound grief. As he is remembered, it is our hope the focus will not be on Robin's death, but on the countless moments of joy and laughter he gave to millions."
In an interview with The Philadelphia Inquirer just before the 1989 release of his career-pivot picture, Dead Poets Society, Mr. Williams talked about his struggle to claim some inner quiet, to calm all the business buzzing in his head.
"Yeah, I have to shut down, literally to that point of really turning it all down to basically white noise," he said.
"Sometimes, it's like a bad game of Pong - the stuff bouncing around. And then when you find what's bouncing around, it's usually old stuff. . . . It bothers me deeply. That's when you've got to clear it out, flush, and go on again."
Mr. Williams is survived by his wife; brother McLaurin Smith Williams; children Zachary Williams, Cody Williams, and the actress Zelda Rae Williams; and stepsons Casey Armusewicz and Peter Armusewicz.
Celebrity colleagues and admirers of Robin Williams shared their reactions to his death
Pam Dawber: "I am completely and totally devastated. What more can be said?"
Steven Spielberg: "Robin was a lightning storm of comic genius and our laughter was the thunder that sustained him. He was a pal and I can't believe he's gone."
Steve Martin: "I could not be more stunned by the loss of Robin Williams, mensch, great talent, acting partner, genuine soul."
Ben Stiller: "His impact on the world was so positive. He did so much good for people. He made me and so many people laugh so hard for a very long time."
President Obama: "Robin Williams was an airman, a doctor, a genie, a nanny, a president, a professor, a bangarang Peter Pan, and everything in between. But he was one of a kind. He arrived in our lives as an alien - but he ended up touching every element of the human spirit."
This article contains information from the Associated Press, the Washington Post, and the Los Angeles Times.