While escaping her home from armed conflict, a young Alma Madrigal loses her husband Pedro but saves her triplet infant children Julieta, Pepa, and Bruno. The candle Alma carries with her becomes magical and creates a sentient house, the "Casita", for the Madrigals to live in. Years later a village grows, protected by the Casita, and members of the Madrigal family are gifted superhuman abilities they use to help the villagers ("The Family Madrigal"). However, Bruno's gift of precognition causes multiple conflicts that lead to the family vilifying him, while Mirabel, Julieta's youngest daughter, is treated differently for having no gift at all.
During the evening of Pepa's youngest son Antonio being gifted with the ability to speak to animals, Mirabel suddenly sees the Casita cracking, but her warnings go unheeded when the Casita is found seemingly fine ("Waiting On A Miracle"). Mirabel, resolving to save the magic of the Casita, goes around to investigate and question her family members. Her older sister Luisa - who possesses superhuman strength - suggests that Bruno's room may hold some clues to the phenomenon ("Surface Pressure"). There, Mirabel sees a cave of sand and pieces of a slab of opaque jade glass, which - when repaired - constitute an image supposedly showing her causing the Casita to fall apart. After Mirabel leaves, she discovers that her family members' gifts are starting to weaken ("We Don't Talk About Bruno").
At a dinner where Mirabel's oldest sister Isabela -who can make flowers grow at will - is to become engaged to neighboring villager Mariano Guzman, Mirabel's oldest cousin Dolores - who possesses superhuman hearing - admits to overhearing Mirabel talking with her father about Bruno's vision. Mariano's proposal gets ruined when the Casita once again begins to crack, causing Pepa - whose emotions control the weather - to conjure up a thunderstorm much to everyone's shock. Isabela then blames Mirabel despite the latter denying her involvement in the cataclysm. Amidst the situation, Mirabel suddenly catches a glimpse of a man who she then chases through a hidden passage in the walls, discovering that he was none other than Bruno himself, who never really left their house because he still loves his family. Mirabel convinces him to make predictions again and gets Antonio's permission to use the latter's room. Bruno makes another vision, which shows the Casita collapsing and an image of Mirabel embracing Isabela.
Mirabel goes to apologize but instead learns of Isabela's burden of being perfect and her desire not to marry Mariano. Having poured out her feelings, Isabela's powers start to develop and both sisters reconcile ("What Else Can I Do?"). However, Alma discovers Mirabel's actions and thoughtlessly blames her for the family's misfortunes. Mirabel then finally snaps at her, saying how everything was truly all her fault for making everyone do things her way. Their argument suddenly creates a gigantic fissure that destroys the Casita while Alma's magical candle extinguishes in Mirabel's hands in her futile effort to save it, effectively stripping the Madrigals of their powers.
Alma later finds a tearful Mirabel at the river where Pedro died and finally admits her fault of pressuring the family, forgetting that the real gift given was not the powers but the family itself ("Dos Oruguitas"). Both reconcile and, with Bruno in tow, reunite the Madrigals to rebuild the Casita, assisted by the villagers. When Mirabel places the last doorknob, the Casita springs back to life and the magic returns ("All Of You"). The movie ends with the Madrigals taking their first family picture with Mirabel and Bruno now included in it ("Colombia, Mi Encanto").