1977. Harry Burns (Billy Crystal) and Sally Albright (Meg Ryan) share a long car ride from the University of Chicago to their new, post graduation lives in NYC. En route, they discuss whether a man and a woman can be friends, without sex getting in the way. Concluding that they cannot be friends, they part ways upon their arrival.
Five years later. Sally and Harry share a plane flight. Sally is now in a relationship with Joe (Steven Ford), while Harry is about to get married to Helen (Harley Kozak). Once again, Harry explains why men and women can't be friends, even if they're in a relationship with other people. They part ways again once the flight is over.
Another five years later. Sally tells her friends, Marie (Carrie Fisher) and Alice (Lisa Jane Persky) she and Joe broke up, while Harry tells his friend, Jess (Bruno Kirby) that Helen has left him. Harry and Sally meet again, in a bookstore, and over dinner discuss their lives. Harry is surprised to realize he has a "woman friend", and they go on to have late night phone conversations (about Casablanca, for example, and whether Ingrid Bergman should have stayed with Humphry Bogart at the end of the movie), go to museums, and so on. Sally feels uncomfortable telling Harry she is dating again, but he encourages her to do so, and tells her about his dates. They discuss his relationships with women, and Sally fakes an orgasm at a diner, to show him it can be done. An older lady (director Rob Reiner's mom, Estelle Reiner) orders "what she's having" for dinner.
Over dinner, Harry tries to match Sally to Jesse, while Sally tries to match Harry to Marie. Marie and Jesse end up together.
Four months later, Harry and Sally are shopping for Jesse and Marie's upcoming wedding, when the bump into Harry ex-wife. Later, we learn that Sally is now dating Gary (Kyle Heffner), while Harry is dating Emily (Tracy Reiner), but when Sally learns that her ex-boyfriend, Joe, is getting married to someone else, she calls Harry in the middle of the night. He comes over to comfort her, and they end up having sex.
Not sure how to handle the situation, Harry and Sally grow apart. At Jesse and Marie's wedding they have a fight, but sometime later, during a new year's eve party, Harry comes over and tell Sally that he loves her. They kiss and, later, get married.