In Santa Cecilia, Mexico, Miguel dreams of becoming a musician, even though his family strictly forbids it. His great-great-grandmother Imelda was married to a man who left her and their daughter Coco to pursue a career in music, and when he never returned, Imelda discarded all forms of music from her family's life before starting a shoemaking business. Miguel now lives with the elderly Coco and their family, most of whom are shoemakers.
Coco suffers from memory loss and has become largely non-verbal. Miguel idolizes famed musician Ernesto de la Cruz and practices his guitar skills in secret.
On the Day of the Dead, Miguel discovers that the photograph of Coco with her parents (her father's face torn off the picture) on the family ofrenda has a hidden section, which shows his great-great-grandfather holding Ernesto's famous guitar. Concluding that he is Ernesto's great-great-grandson, Miguel decides to enter the local talent show against his family's objections.
After Miguel's grandmother destroys his guitar, he breaks into Ernesto's mausoleum and steals the guitar to use in the show. In doing so, however, he becomes invisible to the living but can interact with his skeletal deceased relatives, who are visiting from the Land of the Dead. Taking him back with them, they learn that Imelda cannot visit as Miguel had accidentally removed her photo from the ofrenda. Miguel discovers that he is cursed for stealing from the dead and must return to the Land of the Living before sunrise, or he will become one of the dead. To do so, he must receive a blessing from a family member. Imelda offers Miguel a blessing on the condition that he never plays music again, but Miguel refuses and resolves to seek Ernesto's blessing instead.
Miguel meets trickster Héctor, who declares that he knows Ernesto and offers to help Miguel reach him. In return, Miguel is to help Héctor visit his daughter before she forgets him, causing him to disappear completely. Miguel enters a talent competition with Héctor to win entry to Ernesto's mansion but is forced to flee when his family tracks him down.
He then sneaks into the mansion, where Ernesto welcomes him as his descendant, but Héctor confronts them, renewing an argument with Ernesto from their partnership in life. Miguel realizes that when Héctor decided to return to his family, Ernesto poisoned him and stole his guitar and songs, passing them off as his own to become famous. To protect his legacy, Ernesto seizes the photo and throws Miguel and Héctor into a cenote pit. There, Miguel discovers that Héctor is his actual great-great-grandfather. Héctor only wanted to go to the Land of the Living so he could see Coco again.