Nora Ephron, an essayist and humorist in the Dorothy Parker mold (only smarter and funnier, some said) who became one of her era’s most successful screenwriters and filmmakers, making romantic comedy hits like “Sleepless in Seattle” and “When Harry Met Sally...,” died on Tuesday night in Manhattan. She was 71.

The cause was pneumonia brought on by acute myeloid leukemia, her son Jacob Bernstein said.

In a commencement address she delivered in 1996 at Wellesley College, her alma mater, Ms. Ephron recalled that women of her generation weren’t expected to do much of anything. But she wound up having several careers, all of them successfully and many of them simultaneously.

She was a journalist, a blogger, an essayist, a novelist, a playwright, an Oscar-nominated screenwriter and a movie director — a rarity in a film industry whose directorial ranks were and continue to be dominated by men. Her later box-office success included “You’ve Got Mail” and “Julie & Julia.” By the end of her life, though remaining remarkably youthful looking, she had even become something of a philosopher about age and its indignities.

“Why do people write books that say it’s better to be older than to be younger?” she wrote in “I Feel Bad About My Neck,” her 2006 best-selling collection of essays. “It’s not better. Even if you have all your marbles, you’re constantly reaching for the name of the person you met the day before yesterday.”

Nora Ephron was born on May 19, 1941, on the Upper West Side of Manhattan, the eldest of four sisters, all of whom became writers. That was no surprise; writing was the family business. Her father, Henry, and her mother, the former Phoebe Wolkind, were Hollywood screenwriters who wrote, among other films, “Carousel,”“There’s No Business Like Show Business” and “Captain Newman, M.D.”

“Everything is copy,” her mother once said, and she and her husband proved it by turning the college-age Nora into a character in a play, later a movie, “Take Her, She’s Mine.” The lesson was not lost on Ms. Ephron, who seldom wrote about her own children but could make sparkling copy out of almost anything else: the wrinkles on her neck, her apartment, cabbage strudel, Teflon pans and the tastelessness of egg-white omelets.

She turned her painful breakup with her second husband, the Watergate journalist Carl Bernstein, into a best-selling novel, “Heartburn,” which she then recycled into a successful movie starring Jack Nicholson as a philandering husband and Meryl Streep as a quick-witted version of Ms. Ephron herself.

When Ms. Ephron was 4, her parents moved from New York to Beverly Hills, where she grew up, graduating from Beverly Hills High School in 1958. At Wellesley, she began writing for the school newspaper, and in the summer of 1961 she was a summer intern in the Kennedy White House. She said later that perhaps her greatest accomplishment there was rescuing the speaker of the house, Sam Rayburn, from a men’s room in which he had inadvertently locked himself. In an essay for The New York Times in 2003, she said she was also probably the only intern that President John F. Kennedy had never hit on.

After graduation from college in 1962, she moved to New York, a city she always adored, intent on becoming a journalist. Her first job was as a mail girl at Newsweek. (There were no mail boys, she later pointed out.) Soon she was contributing to a parody of The New York Post put out during the 1962 newspaper strike. Her piece of it earned her a tryout at The Post, where the publisher, Dorothy Schiff, remarked: “If they can parody The Post, they can write for it. Hire them.”

Ms. Ephron stayed at The Post for five years, covering stories like the Beatles, the Star of India robbery at the American Museum of Natural History, and a pair of hooded seals at the Coney Island aquarium that refused to mate.

“The Post was a terrible newspaper in the era I worked there,” she wrote, but added that the experience taught her to write short and to write around a subject, since the kinds of people she was assigned to cover were never going to give her much interview time.

In the late 1960s Ms. Ephron turned to magazine journalism, at Esquire and New York mostly. She quickly made a name for herself by writing frank, funny personal essays — about the smallness of her breasts, for example — and tart, sharply observed profiles of people like Ayn Rand, Helen Gurley Brown and the composer and best-selling poet Rod McKuen. Some of these articles were controversial. In one, she criticized Betty Friedan for conducting a “thoroughly irrational” feud with Gloria Steinem; in another, she discharged a withering assessment of Women’s Wear Daily.

But all her articles were characterized by humor and honesty, written in a clear, direct, understated style marked by an impeccable sense of when to deploy the punchline. (Many of her articles were assembled in the collections “Wallflower at the Orgy,” “Crazy Salad” and “Scribble Scribble.”)

Ms. Ephron made as much fun of herself as of anyone else. She was labeled a practitioner of the New Journalism, with its embrace of novelistic devices in the name of reaching a deeper truth, but she always denied the connection. “I am not a new journalist, whatever that is,” she once wrote. “I just sit here at the typewriter and bang away at the old forms.”

Ms. Ephron got into the movie business more or less by accident after her marriage to Mr. Bernstein in 1976. He and Bob Woodward, his partner in the Watergate investigation, were unhappy with William Goldman’s script for the movie version of their book “All the President’s Men,” so Mr. Bernstein and Ms. Ephron took a stab at rewriting it. Their version was ultimately not used, but it was a useful learning experience, she later said, and it brought her to the attention of people in Hollywood.

Her first screenplay, written with her friend Alice Arlen, was for “Silkwood,” a 1983 film based on the life of Karen Silkwood, who died under suspicious circumstances while investigating abuses at a plutonium plant where she had worked. Ms. Arlen was in film school then, and Ms. Ephron had scant experience writing for anything other than the page. But Mike Nichols, who directed the movie (which starred Ms. Streep and Kurt Russell), said that the script made an immediate impression on him. He and Ms. Ephron had become friends when she visited him on the set of “Catch-22.”

“I think that was the beginning of her openly falling in love with the movies,” Mr. Nichols said in an interview, “and she and Alice came along with ‘Silkwood’ when I hadn’t made a movie in seven years. I couldn’t find anything that grabbed me.” He added: “Nora was so funny and so interesting that you didn’t notice that she was also necessary. I think a lot of her friends and readers will feel that.”

Ms. Ephron followed “Silkwood” three years later with a screenplay adaptation of her own novel “Heartburn,” which was also directed by Mr. Nichols. But it was her script for “When Harry Met Sally...,” which became a hit Rob Reiner movie in 1989 starring Billy Crystal and Meg Ryan, that established Ms. Ephron’s gift for romantic comedy and for delayed but happy endings that reconcile couples who are clearly meant for each other but don’t know it.

Photo

Nora Ephron in 1998 on home turf, the Upper West Side.Credit
Librado Romero/The New York Times

“When Harry Met Sally...” is probably best remembered for Ms. Ryan’s table-pounding faked-orgasm scene with Mr. Crystal in Katz’s Delicatessen on the Lower East Side, prompting a middle-aged woman (played by Mr. Reiner’s mother, Estelle Reiner) sitting nearby to remark to her waiter, indelibly, “I’ll have what she’s having.”

The scene wouldn’t have gotten past the Hollywood censors of the past, but in many other respects Ms. Ephron’s films are old-fashioned movies, only in a brand-new guise. Her 1998 hit, “You’ve Got Mail,” for example, which she both wrote (with her sister Delia) and directed, is partly a remake of the old Ernst Lubitsch film ‘The Shop Around the Corner.”

Ms. Ephron began directing because she knew from her parents’ example how powerless screenwriters are (at the end of their careers both became alcoholics) and because, as she said in her Wellesley address, Hollywood had never been very interested in making movies by or about women. She once wrote, “One of the best things about directing movies, as opposed to merely writing them, is that there’s no confusion about who’s to blame: you are.”

An error has occurred. Please try again later.

You are already subscribed to this email.

Mr. Nichols said he had encouraged her to direct. “I knew she would be able to do it,” he recalled. “Not only did she have a complete comprehension of the process of making a movie — she simply soaked that up — but she had all the ancillary skills, the people skills, all the hundreds of things that are useful when you’re making a movie.”

Her first effort at directing, “This Is My Life” (1992), with a screenplay by Ms. Ephron and her sister Delia, based on a novel by Meg Wolitzer about a single mother trying to become a standup comedian, was a dud. But Ms. Ephron redeemed herself in 1993 with “Sleepless in Seattle” (she shared the screenwriting credits), which brought Tom Hanks and Meg Ryan together so winningly that they were cast again in “You’ve Got Mail.”

Among the other movies Ms. Ephron wrote and directed were “Lucky Numbers” (2000), “Bewitched” (2005) and, her last, “Julie & Julia” (2009), in which Ms. Streep played Julia Child.

She and Ms. Streep had been friends since they worked on “Silkwood” together. “Nora just looked at every situation and cocked her head and thought, ‘Hmmmm, how can I make this more fun?’ ” Ms. Streep wrote in an e-mail on Tuesday.

Ms. Ephron earned three Oscar nominations for best screenplay, for “Silkwood,” “Sleepless in Seattle” and “When Harry Met Sally....” But in all her moviemaking years she never gave up writing in other forms. Two essay collections, “I Feel Bad About My Neck: And Other Reflections on Being a Woman” (2006) and “I Remember Nothing” (2010), were both best sellers. With her sister Delia she wrote a play, “Love, Loss, and What I Wore,” about women and their wardrobes (once calling it “ ‘The Vagina Monologues’ without the vaginas”) and by herself she wrote “Imaginary Friends,” a play, produced in 2002, about the literary and personal quarrel between Lillian Hellman and Mary McCarthy.

She also became an enthusiastic blogger for The Huffington Post, writing on subjects like the Las Vegas mogul Steve Wynn’s accidentally putting a hole in a Picasso he owned and Ryan ONeal’s failing to recognize his own daughter and making a pass at her.

Several years ago, Ms. Ephron learned that she had myelodysplastic syndrome, a pre-leukemic condition, but she kept the illness a secret from all but a few intimates and continued to lead a busy, sociable life.

“She had this thing about not wanting to whine,” the writer Sally Quinn said on Tuesday. “She didn’t like self-pity. It was always, you know, ‘Suck it up.’ ”

Ms. Ephron’s first marriage, to the writer Dan Greenburg, ended in divorce, as did her marriage to Mr. Bernstein. In 1987 she married Nicholas Pileggi, the author of the books “Wiseguy” and “Casino.” (Her contribution to “Not Quite What I Was Planning: Six-Word Memoirs by Writers Famous and Obscure,” edited by Larry Smith and Rachel Fershleiser, reads: “Secret to life, marry an Italian.”)

In addition to her son Jacob Bernstein, a journalist who writes frequently for the Styles section of The Times, Ms. Ephron is survived by Mr. Pileggi; another son, Max Bernstein, a rock musician; and her sisters Delia Ephron; Amy Ephron, who is also a screenwriter; and Hallie Ephron, a journalist and novelist.

In person Ms. Ephron — small and fine-boned with high cheeks and a toothy smile — had the same understated, though no less witty, style that she brought to the page.

“Sitting at a table with Nora was like being in a Nora Ephron movie,” Ms. Quinn said. “She was brilliant and funny.”

She was also fussy about her hair and made a point of having it professionally blow-dried twice a week. “It’s cheaper by far than psychoanalysis and much more uplifting,” Ms. Ephron said.

Another friend, Robert Gottlieb, who had edited her books since the 1970s, said that her death would be “terrible for her readers and her movie audience and her colleagues.” But “the private Nora was even more remarkable,” he added, saying she was “always there for you with a full heart plus the crucial dose of the reality principle.”

Ms. Streep called her a “stalwart.”

“You could call on her for anything: doctors, restaurants, recipes, speeches, or just a few jokes, and we all did it, constantly,” she wrote in her e-mail. “She was an expert in all the departments of living well.”

The producer Scott Rudin recalled that less than two weeks before her death, at Weill Cornell Medical College and New York-Presbyterian Hospital, he had a long phone session with her while she was undergoing treatment, going over notes for a pilot she was writing for a TV series about a bank compliance officer. Afterward she told him, “If I could just get a hairdresser in here, we could have a meeting.”

Ms. Ephron’s collection “I Remember Nothing” concludes with two lists, one of things she says she won’t miss and one of things she will. Among the “won’t miss” items are dry skin, Clarence Thomas, the sound of the vacuum cleaner, and panels on “Women in Film.” The other list, of the things she will miss, begins with “my kids” and “Nick” and ends this way:

“Taking a bath

Coming over the bridge to Manhattan

Pie.”

Correction: June 28, 2012

An obituary on Wednesday about Nora Ephron, the writer and filmmaker, omitted the name of a co-editor of the book “Not Quite What I Was Planning: Six-Word Memoirs by Writers Famous and Obscure,” in which Ms. Ephron is quoted as saying: “Secret to life, marry an Italian.” Besides Larry Smith, the book was also edited by Rachel Fershleiser.

Paul Vitello contributed reporting.

A version of this article appears in print on June 27, 2012, on Page A1 of the New York edition with the headline: Writer and Filmmaker With a Genius for Humor. Order Reprints|Today's Paper|Subscribe