In 2013, Mitsuha Miyamizu is a high school girl living in the rural town of Itomori, Japan. Bored of the town, she wishes to be a Tokyo boy in her next life. One day, she inexplicably begins to switch bodies intermittently with Taki Tachibana, a high school boy in Tokyo, who wakes up as her and has to live through her activities and social interactions for the day. They learn that they can communicate with each other by leaving messages on paper, phones, and sometimes on each other’s skin. Mitsuha (in Taki’s body) sets Taki up on a date with coworker Miki Okudera, while Taki (in Mitsuha’s body) causes Mitsuha to become popular at school. One day, Taki (in Mitsuha’s body) accompanies Mitsuha’s grandmother Hitoha and younger sister Yotsuha to leave the ritual alcohol kuchikamizake, made by the sisters, as an offering at the Shinto shrine located on a mountaintop outside the town. It is believed to represent the body of the village guardian god ruling over human connections and time. Taki reads a note from Mitsuha about the comet Tiamat, expected to pass nearest to Earth on the day of the autumn festival. The next day, Taki wakes up in his body and goes on a date with Miki, who tells him she enjoyed the date but also that she can tell that he is preoccupied with thoughts of someone else. Taki attempts to call Mitsuha on the phone, but cannot reach her as the body-switching ends.
Taki, Miki, and their friend Tsukasa travel to Gifu by train on a trip to Hida in search of Mitsuha, though Taki does not know the name of Itomori, relying on his sketches of the surrounding landscape from memory. A restaurant owner in Hida recognizes the town in the sketch, being originally from there. He takes Taki and his friends to the ruins of Itomori, which has been destroyed and where 500 residents were killed when Tiamat unexpectedly fragmented as it passed by Earth three years earlier. Taki observes Mitsuha’s messages disappear from his phone and his memories of her begin to gradually fade, realizing that the two were also separated by time, as he is in 2016. Taki finds Mitsuha’s name in the record of fatalities. While Miki and Tsukasa return to Tokyo, Taki journeys to the shrine, hoping to reconnect with Mitsuha and warn her about Tiamat. There, Taki drinks Mitsuha’s kuchikamizake then lapses into a vision, where he glimpses Mitsuha’s past. He also recalls that he encountered Mitsuha on a train when she came to Tokyo the day before the event to find him, though Taki did not recognize her as the body-switching was yet to occur in his timeframe. Before leaving the train in embarrassment, Mitsuha had handed him her hair ribbon, which he has since worn on his wrist as a good-luck charm.
Taki wakes up in Mitsuha’s body at her house on the morning of the festival. Hitoha deduces what has happened and tells him the body-switching ability has passed down in her family as caretakers of the shrine. Taki convinces Tessie and Sayaka, two of Mitsuha’s friends, to get the townspeople to evacuate Itomori, by disabling the electrical substation and broadcasting a false emergency alert. Taki heads to the shrine, realizing that Mitsuha must be in his body there, while Mitsuha wakes up in Taki’s body. At the mountaintop during sunset, the two sense each other’s presence, but are separated due to contrasting timeframes and cannot see each other. When twilight falls, they return to their bodies and see each other in person. After Taki returns Mitsuha’s ribbon, they attempt to write their names on each other’s palms so that they will remember each other. Before Mitsuha can write hers, however, twilight passes, and they revert to their respective timeframes. When the evacuation plan fails, Mitsuha has to convince her father Toshiki, the mayor of Itomori, to evacuate everyone. Before doing so, Mitsuha notices her memories of Taki are fading away and discovers he wrote “I love you” on her hand instead of his name. After Tiamat crashes, Taki, in his timeframe, remembers nothing.
Five years later, Taki has graduated from university and searches for a job. He senses that he lost something important that he cannot identify, and feels inexplicable interest in the events surrounding Tiamat, now eight years in the past. The town of Itomori had been destroyed; however, all of its people survived as they had evacuated just in time. Mitsuha has since moved to Tokyo. Sometime later, Taki and Mitsuha glimpse each other when their respective trains pass each other and are instantly drawn to seek one another. Each disembarks and races to find the other, finally meeting at the stairs of Suga Shrine. Taki calls out to Mitsuha, saying that he feels that he knows her, and she responds likewise. Having finally found what each had long searched for, they shed tears of happiness and simultaneously ask each other for their name.