It's 1977; Harry Burns (Billy Crystal) and Sally Albright (Meg Ryan) share a car ride to New York City after graduating from the University of Chicago. They are not exactly friends but they are not exactly strangers either since Harry is dating Sally's friend Amanda. After running out of pleasantries, and exhausting standard small talk, they start a discussion about whether and man and a woman can be friends without sex getting in the way. They conclude overwhelmingly that they can't. Once they arrive in New York, they say goodbye and part ways after an argument that begins over dinner when Sally accuses Harry of hitting on her.
It's 1982; Sally and Harry find themselves on the same plane flight. Sally is in a relationship with Joe (Steven Ford) and Billy is engaged to be married to Helen (Harley Kozak). Harry begins to take up their conversation about platonic relationships again, and extends it, this time claiming that even if a man and a woman are involved in relationships with other people, they still cannot be friends. Once again they say goodbye at the end of the journey and go their separate ways.
Now it's 1987 and Sally tells her best friends Marie (Carrie Fisher) and Alice (Lisa Jane Persky) that she and Joe have broken up because Joe didn't want to get married; by strange coincidence Billy has been dumped by Helen, who has left him for another man, and he explains this to his close friend Jesse (Bruno Kirby). Harry and Sally run into each other in a bookstore and decide to go to dinner together to catch up on each other's lives. Despite Harry's lifelong belief that men and women cannot be friends, he realizes that now, in Sally, he actually has a female friend. The two spend a lot of time together; they talk on the phone late at night, spend time at museums, all whilst remaining "just friends". Sally begins dating again and feels awkward about it when she tells Harry but he is very encouraging and also starts to tell her about his dates as well. At one meal in a diner, Sally fakes an orgasm when Billy protests that he is absolutely able to tell the difference between a woman who is faking and the real thing. This opens the door for the most famous line from the film' the woman sitting behind Harry and Sally says, "I'll have what she's having".
Harry and Sally are at a New Year's Eve party when they find themselves attracted to each other, but they decide to set each other up with their respective best friend, Marie and Jess. The four go out on a double date, but it is Marie and Jess who end up in a relationship together, which soon becomes an engagement. Four months later, Harry and Sally are both in relationships with other people, but when Sally learns that Joe is getting married it affects her very badly; she calls Harry to talk about how she feels and he comes over to comfort her, but they end up having sex. This seems to prove Harry's long held theory that men and women cannot be friends because sex gets in the way; they both feel awkward about their night together and they drift apart, spending much less time together. They have a fight at Jesse and Marie's wedding,
Sally feels as though it is not New Year's that year because she is not spending it with Billy. For his part, Billy spends the night walking aimlessly around New York City but decides to go to the party he had been invited to so that he can see Sally. She is leaving the party early, but Harry declares his love for her. She tells him at first that he is only saying that because he is lonely, but he lists all of the things that he loves about her. Sally finally believes his declarations of love. They share a kiss and three months later they get married.