Family matriarch Imelda Rivera was the wife of a musician who left her and her daughter Coco to pursue a career in music. She banned music in the family and turned to shoemaking, which became the family business. Her great-great-grandson, 12-year-old Miguel, now lives with the elderly Coco and their family in a small Mexican village. He secretly dreams of becoming a musician like Ernesto de la Cruz, a popular film/singing star of Imelda’s generation. One day, Miguel damages the photo of Imelda at the center of the family ofrenda and removes it, discovering that her husband (whose face is ripped out) was holding Ernesto’s famous guitar. Later, when Miguel attempts to enter a talent show for the Day of the Dead, his grandmother Elena destroys his guitar.
Concluding that he is Ernesto’s great-great-grandson, Miguel enters his tomb and steals his guitar to use in the show. When he strums it, he becomes invisible to everyone in the village plaza, but can see and be seen by his Xoloitzcuintli dog Dante and his skeletal dead relatives who are visiting from the Land of the Dead for the holiday. Taking him there, they find that Imelda is unable to cross over as her photo has been removed from the ofrenda. Miguel 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 his family that can undo the curse placed upon him by stealing Ernesto’s guitar. Imelda offers Miguel a blessing on the condition that he abandon his musical pursuits, and unwilling to accept Imelda’s conditions, Miguel seeks Ernesto’s blessing instead.
Miguel encounters Héctor, a down-on-his-luck skeleton who once played with Ernesto and offers to help Miguel reach him. In return, Héctor asks Miguel to take his photo back to the Land of the Living so he can visit his daughter before she forgets him and he disappears completely. Héctor attempts to return Miguel to his relatives, but Miguel escapes and infiltrates Ernesto’s mansion, learning along the way that an old friendship between the two had soured before Héctor’s death. Ernesto welcomes Miguel as his descendant, but Héctor confronts them, imploring Miguel to take his photo. Héctor realizes the truth about his death: Ernesto poisoned him and stole the songs he had written, passing them off as his own to become famous. Ernesto steals Héctor’s photo and has him and Miguel thrown into a cenote pit.
Miguel realizes that Héctor is, in truth, his great-great-grandfather and that Coco is his daughter, the only living person who still remembers him. With the help of Dante – revealed to be an alebrije – the dead Riveras find and rescue them. Miguel explains that Héctor’s death was the result of his decision to return home to her and Coco, and Imelda and Héctor reconcile. They infiltrate Ernesto’s sunrise concert to retrieve Héctor’s photo from Ernesto and reveal him as a fraud to the crowd. Ernesto is crushed by a falling bell, mimicking his actual death, but the photo is destroyed once it reaches the water.
As the sun rises, Héctor is in danger of being forgotten and disappearing. Imelda blesses Miguel without conditions so he can return to the Land of the Living, where he plays a song for Coco that Héctor wrote for her during her childhood. The song sparks her memory of Héctor and revitalizes her, and she gives Miguel the torn-out piece of the photo from the ofrenda, which shows Héctor’s face. Elena reconciles with Miguel, accepting both him and music back into the family.
One year later, Miguel proudly presents the family ofrenda – featuring a photo of the now deceased Coco – to his new baby sister. Letters saved by Coco contain proof that Ernesto stole Héctor’s music; as a result, Ernesto’s legacy is destroyed and the public forgets him and honors Héctor in his place. In the Land of the Dead, Héctor and Imelda join Coco for a visit to the living Riveras as Miguel sings and plays for his relatives, both dead and living.