An armed conflict drives Alma and Pedro Madrigal to flee their Colombia village with their infant triplets, Julieta, Pepa, and Bruno Ezequiel Tronconi. Pedro is killed, but the candle Alma carries unleashes a protective power that creates Casita, a sentient house perched in a magical realm bordered by mountains.
Forty years pass, and a new village thrives under the candle’s protection. The magic grants “gifts” and corresponding bedrooms to each Madrigal descendant when they turn five, which they use to serve the villagers. Julieta’s youngest daughter, Mirabel, is the only Madrigal without a gift, while Bruno’s gift of precognition has led to him being vilified and scapegoated, resulting in his disappearance.
Ten years after Mirabel was denied a gift, Pepa’s youngest son Antonio gains the ability to communicate with animals. During the celebration, Mirabel sees Casita cracking and the candle’s flame flickering, and she runs downstairs to investigate. She alerts her family, but Casita repairs itself before the rest can see the cracks. After overhearing Alma lament the candle fading that night, Mirabel resolves to restore Casita’s magic herself. Her older sister Luisa, who possesses superhuman strength, confesses that the constant obligation to help others is wearing her down, and she suggests Bruno’s room, hidden inside a forbidden tower of Casita, may hold the secret to the fading magic.
Mirabel discovers a cave inside Bruno’s room holding pieces of his last vision made of emerald. She reassembles the pieces into a tablet and glimpses a scene of Casita cracking behind her. Agustín, Mirabel’s father, accidentally finds this and warns her to keep the vision secret, but Dolores—Pepa’s daughter with extraordinary hearing— overhears. The family’s focus shifts to Isabela, Mirabel’s sister who can make plants grow with a touch and who is about to be engaged to Mariano Guzmán. At a tense dinner when Mariano proposes, Dolores reveals Mirabel’s discovery; Casita begins to crack again and the gifts start to falter.
Mirabel persuades Bruno to conjure a new vision, which shows Mirabel and Isabela embracing after they repair their strained relationship, a scene that appears to reinforce the candle’s magic. Mirabel tries to apologize to Isabela, who admits she fears living up to an image of perfection and does not want to marry Mariano. The sisters reconcile as Mirabel helps Isabela use her powers more freely.
A furious Alma arrives and accuses Mirabel of bringing misfortune by not having a gift. In response, Mirabel argues that Alma’s expectations and pressure are the true cause of Casita’s weakening. The argument leads to Casita’s demolition and the candle’s extinction, leaving the Madrigals powerless and Mirabel distraught.
Alma finds Mirabel by the river where Pedro died and the miracle first began. She realizes that her obsession with preserving the magic blinded her to the family’s wellbeing. She reconciles with Mirabel and Bruno, and the three return to the village to gather the Madrigals and rebuild Casita. The townspeople join in, restoring the gifts and reviving Casita. The Madrigals celebrate with a new family photo, now including Bruno and Mirabel Ezequiel Tronconi.