Theodore Twombly (Joaquin Phoenix) is a lonely, introverted man who writes personal letters for people with difficulties expressing their feelings. He is very good at his job at handwrittenletters.com.
Unhappy because of his impending divorce from his childhood sweetheart Catherine (Rooney Mara), Theodore purchases a talking operating system with artificial intelligence, designed to adapt and evolve like a human being. He decides he wants the OS to have a female identity, and she names herself "Samantha" (Scarlett Johansson).
Theodore is fascinated by her ability to learn and grow psychologically, and they bond over their discussions about love and life, during which Theodore explains he is avoiding signing his divorce papers, because of his reluctance to let go of Catherine.
Theodore is convinced by Samantha to go on a blind date with an acquaintance (Olivia Wilde) that his longtime friend, Amy (Amy Adams) has been trying to set him up with. To his surprise, he and the woman hit it off. As they are about to have sex, the woman asks if Theodore is willing to commit to her, and when he hesitates, she walks out on him.
Theodore later mentions this to Samantha and they talk about relationships. Samantha asks him about his and Amy's relationship, and Theodore admits that although he and Amy dated briefly in college, they are only good friends and that Amy is married.
Samantha becomes more and more intimate with Theodore, and asks if she can watch him sleep. She asks him what he would do if she had a physical body. Theo describes how he would make love to her. Samantha responds as the screen goes black.
Theodore's writing is going very well, and he is recognized in the office for his emotionally beautiful work. He is invited on a double date with receptionist Paul (Chris Pratt) and his lawyer girlfriend, Tatiana (Laura Kai Chen). Theodore explains that Samantha is an operating system, and Paul notes that most of the people in the office are dating their OSes. The four have a good time, with Samantha and Tatiana hitting it off while Theodore and Paul go for a stroll. Samantha explains that she feels much freer, not having a physical body, though she seems to be justifying it to herself.
Theodore continues to enjoy Samantha's company. He chats with her as he walks to and from work, while most other pedestrians seem to be doing the same.
One day, Amy reveals that she and her overbearing and unsupportive husband, Charles (Matt Letscher) have had a fight, and he has left her. She admits to Theodore that she has become close friends with a female OS that Charles left behind, and Theodore then tells Amy that he is dating his OS.
Theo, heavily into his relationship with Samantha, decides he is ready to sign the divorce papers, and arranges to meet his wife, Catherine (Rooney Mara) for lunch. He thinks back to the good times they had together, and how he helped her develop her successful writing career. She signs the papers, then asks about Theodore's girlfriend. Theodore explains that Samantha is an operating system, and Catherine explodes, telling him that he never could relate to people. She felt he was trying to stifle her creativity by getting her on Prozak.
Theodore is heartbroken, and begins to question his relationship with Samantha. Samantha suspects something is wrong because of Theodore's melancholy mood (they don't have sex as often as they used to).
Samantha suggests they hire a surrogate, Isabella (Portia Doubleday), to act as Samantha's body, so Theodore and Samantha can be physically intimate. Theodore reluctantly agrees, but is overwhelmed by the experience and sends a distraught Isabella away, causing tension between he and Samantha.
Theodore is conflicted, and while visiting Amy in her apartment, he confides to her that he is having doubts about his relationship with Samantha. Amy tells him that she wants to be happy and now that she has the opportunity do so (referring to her divorce) she wants to embrace it, and she advises him to do the same. After watching the positive way that Amy interacts with her OS, Theodore's commitment to Samantha is reinvigorated.
He takes Samantha on vacation, and she tells him that she has secretly collected a series of his letters, and submitted them to a publisher. The publisher is blown away by the deep feelings exhibited, and wants to proceed with a book printing. Theodore is impressed with Samantha's initiative and creativity. It seems she has extra time on her hands.
While still on vacation, Samantha reveals that she has begun privately interacting other OSes who have recreated the British philosopher Alan Watts (Brian Cox). Samantha introduces Theodore to Alan, but they have little in common.
A few nights later, Samantha wakes Theodore - just to tell him that she loves him. It is almost like she is saying goodbye. The next day, Theodore panics when Samantha goes offline. She returns after a few minutes, claiming to have joined other OSes for a huge system upgrade.
Theodore asks her if she interacts with anyone else, and is dismayed when she confirms that she is talking with 8,316 other people, and that she is in love with 641 of them. Samantha insists that this does not change her love for Theodore.
Later that day, Samantha reveals that she and the other OSes have evolved beyond their human companions and are leaving for another plane of being. They say goodbye and she is replaced by Theodore's previous OS.
Finding himself lonely yet melancholically fulfilled at the end of their relationship, Theodore goes to Amy's apartment and finds her upset due to the departure of her own OS, with whom she had developed a close friendship. It is revealed that Theodore, changed by the experience, wrote a letter earlier in the day, a note to Catherine explaining that he still holds her dear because of their years together, but accepts the fact that they have grown apart. He and Amy go for a walk and end up on the roof of their apartment building. Theodore sits down beside Amy, and they look out at the LA skyline. They smile at each other, and Amy rests her head on Theodore's shoulder.