In 1976, eight-year-old Mary Daisy Dinkle, Bethany Whitmore, leads a lonely life in Mount Waverley, Victoria, Australia. Her classmates tease her for a birthmark on her forehead, and her father Noel remains distant while her mother Vera — an alcoholic, kleptomaniac — offers little support. Her small comforts are her pet rooster Ethel, her favorite food condensed milk, and a Smurfs-like cartoon show called The Noblets. While at the post office with her mother, Mary spots a New York City telephone book and, curious about Americans, decides to write to one. She randomly selects Max Jerry Horowitz, Philip Seymour Hoffman, and sends him a letter about herself.
Max is a morbidly obese 44-year-old Jewish atheist who grapples with forming relationships due to a mix of mental and social struggles. Mary's letter initially triggers an anxiety attack, but he writes back, and the two become friends — partly because of their shared love of chocolate and The Noblets. Vera disapproves of Max, so Mary suggests he write to her agoraphobic neighbor Len Hislop, John Flaus. Mary asks Max about love, and he endures a severe anxiety episode that leads to eight months in an institution. He later wins the New York Lottery, buying a lifetime supply of chocolate and the entire collection of Noblet figurines; the leftovers go to his elderly neighbor Ivy, who pampers herself before dying in a jet-pack-related accident. Mary grows despondent, believing that Max has abandoned her.
Max eventually writes back, explaining that he has Asperger syndrome. The two keep up their correspondence for the next several years. When Noel retires, he takes up metal detecting and is swept away by a powerful tidal bore while on a beach. Mary, now an adult, attends the University of Melbourne, has her birthmark removed, and develops a crush on her next‑door neighbor, Damien Popodopoulos, Eric Bana. Vera accidentally drinks embalming fluid instead of cooking sherry and dies, shaking Mary’s world further. Mary and Damien marry, though Damien is shown to be uncomfortable with intimacy.
Mary studies psychology and writes a doctoral dissertation on finding a cure for Asperger syndrome, using Max as her case study, despite his earlier statements about not needing or wanting to be cured. She sends Max a copy, and he becomes furious, believing she has exploited him. He sabotages the project by removing the letter "M" from his typewriter, effectively ending their correspondence. Mary has the entire run of her book pulped, a blow that leaves her depressed and drinking. She finds a can of condensed milk and sends it to Max as an apology. She later receives a letter from Damien informing her that he has left her for his pen pal, Desmond.
After a violent outburst toward a homeless man (triggered by a cigarette thrown on the ground), Max realizes that everyone is imperfect like himself. He resolves to forgive Mary and sends her his Noblet figurine collection. Mary, however, does not immediately find the box on her doorstep. Unbeknownst to her, she is pregnant with Damien’s child. She contemplates suicide until Len alerts her to Max’s package. A letter from Max reveals his realization that they are not perfect, yet they cherish their friendship and what they have shared across years.
One year later, Mary travels to New York with her infant to visit Max. She discovers him dead on his couch, peacefully gazing upward. All the letters she sent over the years are taped to the ceiling, a testament to the enduring value Max placed on their friendship. Morally and emotionally moved, Mary sits beside him, cries tears of joy, and carries the memory of their bond forward as she faces an uncertain yet hopeful future.