Alvin Sargent, 92, a Hollywood screenwriter who was born in Philadelphia and had to drop out of Upper Darby High School due to the outbreak of World War II, died Thursday, May 9, at his home in Seattle.

Mr. Sargent specialized in haunting explorations of characters’ insecurities and imperfections. He won Academy Awards for Julia and Ordinary People before enchanting a younger generation of viewers with his work on Sony’s Spider-Man franchise.

His agent David Gersh confirmed the death but said he did not know the cause.

Mr. Sargent worked as a television writer before turning to films in the mid-1960s, embarking on a career that veered from Westerns to romantic comedies to coming-of-age movies, with a focus on characters undergoing radical transformations — whether as the result of family tragedy or a genetically engineered arachnid.

“You just can’t get through life happily without experiencing some degree of love and pain,” Mr. Sargent once said, according to Donald Chase’s book Filmmaking: The Collaborative Art. “That theme is something I could deal with forever.”

Typically drawing from plays or novels, Mr. Sargent wrote more than two-dozen screenplays, painstakingly stitching together scenes as they came to him, rather than using an intricate outline or following the source material page by page.

He worked on movies including The Effect of Gamma Rays on Man-in-the-Moon Marigolds (1972), based on the Pulitzer Prize-winning play by Paul Zindel; Straight Time (1978), starring Dustin Hoffman as a prisoner who is released on parole but returns to a life of crime; and What About Bob? (1991), with Bill Murray as a neurotic patient who follows his psychiatrist, played by Richard Dreyfuss, on a family vacation to New Hampshire.

Mr. Sargent was nominated for three Academy Awards, beginning with the 1973 comedy Paper Moon, adapted from the novel Addie Pray by Joe David Brown. Directed by Peter Bogdanovich, the film starred Ryan O’Neal as a Depression-era swindler, with Tatum O’Neal, his daughter, as his accomplice. She went on to win the Academy Award for best supporting actress, becoming the youngest competitive winner in Oscars history at age 10.

Mr. Sargent wrote two episodes of a short-lived television series adapted from the film, and won his first Academy Award for Julia (1977), drawn from the memoir of playwright Lillian Hellman. Told through flashbacks, the film centered on the friendship between Hellman (Jane Fonda) and her childhood friend Julia (Vanessa Redgrave), who enlisted the author’s help in supporting an anti-Nazi group in World War II-era Germany.

To most critics, Mr. Sargent’s greatest triumph was Ordinary People (1980), adapted from the best-selling novel by Judith Guest. The film marked Robert Redford’s directorial debut, and chronicled the daily lives of the suburban Jarrett family — played by Donald Sutherland, Mary Tyler Moore, and Timothy Hutton — more than a year after their eldest son’s death in a boating accident.

“The Jarretts become important people without losing their ordinariness, without being patronized or satirized,” wrote New York Times reviewer Vincent Canby. “Ordinary People,” he added, “is a moving, intelligent and funny film about disasters that are commonplace to everyone except the people who experience them.”

The movie won four Academy Awards, including best picture and best adapted screenplay for Mr. Sargent, whose dialogue dissected the family’s emotional trauma and loneliness. When Hutton’s character visits a psychiatrist, he recalls his mother’s anger that he bled on the bathroom rug during a suicide attempt.

"She had to pitch it out," he says. "They even had to regrout the tile floor."

Mr. Sargent was a teenager when his father, a hay-and-grain salesman, died by suicide. He often returned to familial themes, including in Anywhere But Here (1999), which starred Susan Sarandon and Natalie Portman as an eccentric mother and daughter in Beverly Hills.

“Thank God for dysfunctional families,” Mr. Sargent told the Los Angeles Times before the film’s release. “They’re God’s gift to writers. Émile Zola said, show me a family with a mother, father and two children and I’ll show you a whole library full of books.”

Alvin Supowitz was born in Philadelphia on April 12, 1927. Like his older brother, Herb Sargent, a television comedy writer who helped create the “Weekend Update” segment on Saturday Night Live, he changed his surname to help launch his writing career. “It’s an easier name to sell in Hollywood,” Mr. Sargent once told the New York Times.

Mr. Sargent dropped out of high school in Upper Darby to join the Navy during World War II. He learned to type, taking down Morse code messages, and later told the Writers Guild Foundation that as a young man his “one passion was typing, not writing.”

It was only to practice his typing skills that he began writing dialogue. He moved to Los Angeles after the war and worked as a waiter, deliveryman, and ad salesman for Variety, launching a brief acting career with an uncredited appearance in From Here to Eternity (1953).

Beginning in the late 1950s, Mr. Sargent wrote for television series, including The Alfred Hitchcock Hour, Naked City, Empire, and Route 66. His first screenplay was Gambit (1966), a spy spoof he and Jack Davies adapted from a short story by Sidney Carroll.

Mr. Sargent’s other movies included The Stalking Moon (1968), a Gregory Peck Western; The Sterile Cuckoo (1969), starring Liza Minnelli as a manic college freshman; Bobby Deerfield (1977), a race-car romance with Al Pacino; and White Palace (1990), a love story featuring Sarandon and James Spader. He also wrote the original screenplay for Love and Pain and the Whole Damn Thing (1973), a romantic comedy directed by Alan J. Pakula.

Mr. Sargent had never written a comic-book story when producer Laura Ziskin, his longtime companion, reportedly asked him to do a rewrite of Spider-Man (2002). He said he saw “mythic” qualities to its story of a lonely, guilt-ridden teenager, and became a creative pillar of the franchise, which helped spur a wave of superhero movies after it grossed more than $800 million at the box office.

Although Mr. Sargent was uncredited in the first film, he co-wrote its two sequels and a 2012 reboot. He was notably the lead screenwriter for Spider-Man 2, which film critic Roger Ebert described as “the best superhero movie since the modern genre was launched with Superman (1978).”

Mr. Sargent’s marriage to Joan Camden, a television actress, ended in divorce. In 2010, he married Ziskin, who died of breast cancer the next year. Survivors include daughters Amanda Sargent and Jennifer Sargent, and a stepdaughter, Julia Barry.

Although he remained productive for more than four decades, Mr. Sargent often spoke of the struggles he faced as a writer, both in polishing his screenplays and in finding studio backers to bring them to life. “When I die,” he sometimes quipped, “I’m going to have written on my tombstone: ‘Finally, a plot.’”