Hector is a quirky psychiatrist who has become increasingly tired of his humdrum life. He tells his girlfriend, Clara, that he needs to go on a journey to research happiness. On a flight to China, he is seated next to Edward, a cranky businessman. Edward takes Hector to a very exclusive nightclub in Shanghai, where Hector meets a young woman named Ying Li and instantly falls for her.
He asks to meet Ying Li’s family. She declines, ashamed of how she makes her living. Their date is interrupted by her pimp, who takes Ying Li away by force. Hector then ventures into the mountains and visits a monastery, where he befriends their leader and talks briefly with Clara via Skype.
Hector departs on a terrifying plane ride to Africa, where a woman invites him to her family’s house for sweet potato stew, and gives him a book about happiness written by one Professor Coreman. Hector meets up with his old friend Michael, a physician, with his bodyguard Marcel, and later meets a quick-tempered drug lord named Diego Baresco, who doesn’t believe in happiness because his wife is unhappy due to her medication, but loans Hector a pen to write down a prescription for his wife.
Hector discovers that Marcel is Michael’s lover, and they are happy. He Skypes again with Clara, who is going out in a fancy gown and seems uninterested in talking to him. He visits the local woman who he befriended on the plane and her family for dinner. His vehicle is carjacked and Hector is kidnapped and locked in a rat-infested cell. When the kidnappers decide to kill him, Hector claims to be friends with Diego to save himself, but cannot prove it. With a gun pointed at his head, Hector asks if he can make one final note in his book about what brings his captors happiness, revealing the pen engraved with Diego’s name to the kidnappers. Upon his release, Hector makes his way back to the village where he celebrates with the locals.
While flying to Los Angeles, Hector attends to a woman with a Brain tumor. Hector then goes to the beach in Santa Monica and encounters Agnes, an old girlfriend, who is now happily married with children. Hector calls Clara and they break up in an argument.
Agnes and Hector meet with Professor Coreman, who is studying the effects of happiness on the brain. During a lecture, Coreman points out that people shouldn’t be concerned with the pursuit of happiness, but with the happiness of pursuit. Agnes and Hector check out a project Coreman has been working on, which monitors brain activity in real time and how it reacts to different emotions.
Agnes is instructed to go into an isolated room and think about three things: times when she was happy, sad and scared. Through his brain-scanning technology, Coreman is able to tell in which order she thought about the three emotions. When Hector takes his turn, he thinks about Clara marrying someone else, about his time being kidnapped, and about Ying Li, but his emotions are strangely blocked. He receives a call from remorseful Clara, who tells him she wants to be a mother. Hector explains what he’s learned, that the most unhappy thing he could imagine would be to lose her. Suddenly Hector’s brain scan erupts with a flurry of activity, mimicking the colored flags from the monastery and revealing that true happiness isn’t just one emotion; it’s all of them. Having finally achieved his own happiness, Hector rushes home and marries Clara.