Bitti (Kriti Sanon) is a young contemporary girl in Bareilly, Uttar Pradesh, who works in the complaint department of the local electricity board and is the apple of her father’s eye. Like most Indian mothers, Bitti’s mother wants to see her daughter get married to a nice man from a good family. Bitti, however, wants a husband who understands her and, more importantly, who accepts her exactly the way she is. A suitor comes but after knowing his disgusting mindset, she lies about not being a virgin and gets rejected. Her mother gets irritated with the constant rejections, but her father understands her. She gets heartbroken after hearing her parents conversation and later pours her heart out before her father who consoles and cheers her.
That night, despite having nowhere to go, she leaves her house and boards a train. While on a train platform, she chances upon a book at a bookstall and buys it. As she reads the novel entitles Bareilly Ki Barfi, Bitti starts to identify with the protagonist. Having found acceptance in the pages of the book, she decides to return home the same night. She longs to meet the writer and thus one day decides to search for the supposed writer of the book, Pritam Vidrohi (Rajkummar Rao). She goes back to the same bookstall where she had brought that book and asks about its writer. The bookshop owner directs her to Chirag Dubey (Ayushmann Khurana), who owns a printing press and who helped publish the book.
What Bitti doesn’t know is that Chirag is in fact the true author of the book. He had written that book five years previously, after undergoing pain when his girlfriend ditched him and married someone else. He wrote that book describing his girlfriend Bubbly and their love story. Since giving his own name as the writer might destroy his ex-girlfriend’s reputation, he coaxes one of his meek, so-called friend “Pritam Vidrohi” to have his name as the writer of the book. Vidrohi agrees but gets so scared of the possible future scenarios, that he leaves the city without telling anyone. He need not have been so worried, because in the five years since the book had been self-published by Chirag, not a single copy had ever been sold, except the copy that Bitti had purchased on the railway platform that day.
Bitti tries to get Vidrohi’s whereabouts from Chirag but Chirag successfully manages to convince her to write letters to the author instead of meeting him personally. She writes a letter to Vidrohi for Chirag to pass on to him. Chirag, being the true author, writes back and passes it off as Vidrohi’s response. Thus begins a correspondence between Bitti and ‘Vidrohi’. In the meantime, Chirag and Bitti get to know each other better and become good friends. Bitti, however, starts to lose patience when Vidrohi, despite her repeated requests, refuses to meet her. She broaches this with Chirag and implores him to arrange for her to meet Vidrohi just once. Chirag agrees and as he has fallen for Bitti and decides to tell her the truth, that he is the actual writer. But later he learns that Bitti’s mother hates that writer for spoiling their daughter’s mind and thus decides not to tell the truth, instead search for Vidrohi and make him the scapegoat.
Chirag visits Lucknow, where Vidrohi works as a salesman in a saree showroom, and convinces him to act like a boor, with a bad & short-tempered attitude, so that Bitti will be cured of her long-distance infatuation. Thus, at first meeting with Bitti, Vidrohi, as instructed, pretends to be a rude and boorish person, causing Bitti to get annoyed leave. However, despite his rude behaviour, Vidrohi shows a sensitive side, that ultimately makes Bitti and her family have second opinion. Bitti invites Vidrohi for the celebration of the 50th anniversary of her family sweet shop. Instead of going along with Chirag’s plan (which was refusing and leaving for Lucknow), Vidrohi accets the invitation, saying that he doesn’t want to break her heart. A furious Chirag stars beating up Vidrohi in the evening, until Vidrohi reveals the real reason why he decided to stay back: He had fallen for Bitti’s friend, Rama. Seeing how this would kee Vidrohi and Bitti apart, Chirag tells him he fully supports Vidrohi, when in reality, he doesn’t care, as long as Vidrohi stays away from Bitti. Bitti’s mother, however, sees the perfect son-in-law in Vidrohi. Chirag lies about Vidrohi saying that he is a divorcee (since marrying a divorcee is considered a taboo).
One day, when Chirag, Vidrohi, Bitti and Rama go on an outing together, Vidrohi reveals his feelings for Rama to her. While Rama does like him, she rejects him because she (indirectly) learned from Chirag that he is a divorcee. After years of bullying, this turns out to be the final straw for Vidrohi and tells Chirag that he will take away Chirag’s girl with a snap of his fingers. Chirag, believing that Bitti will never fall for someone like Vidrohi, accepts the challenge. To his shock, Vidrohi’s jerk with a heart of gold persona starts winning over Bitti and everybody’s hearts. Ultimately Vidrohi comes to Chirag and Munna and invites them to his wedding engagement with Bitti. Chirag threatens to reveal everything to Bitti, saying that if he can’t be happy, then no one should be. Vidrohi calls Chirag out for his selfishness and tells him he can do whatever he wants. Chirag goes to Bitti to tell her the truth, but is unable to say anything to her after seeing how happy she is. He realizes how his selfishness had blinded him and how he never cared about anybody else’s happiness. He realizes that he is happy as long as Bitti is happy, and how he himself is responsible for everything. He writes some lines for Bitti on behalf of Vidrohi, and meets him. Chirag apologizes Vidrohi for dragging him into the mess and for his behaviour. Vidrohi forgives him and he requests Chirag to come to his engagement, this time in a very sincere manner.
On the day of engagement, Vidrohi says he has a sore throat asks Chirag to recite those lines for Bitti. Chirag begins to recite the lines, but his emotions overcome him. The entire speech leaves everyone in tears. Seeing how Chirag is willing to let Bitti marry Vidrohi for the sake of her happiness, she decides to reveal the truth: Vidrohi had revealed everything to Bitti including the fact that Chirag was the real author of Bareilly ki Barfi, and everything, from Vidrohi refusing to go back to Lucknow, to Rama rejecting him, to Bitti and Vidrohi’s engagement, to Vidrohi conveniently having a sore throat at the very last moment, was an act, just to test whether Chirag really loved Bitti, or if he just was in love with the shadow of his ex-girlfriend, Bubbly, that he saw in her. She reveals that she too is in love with Chirag. Chirag apologizes to Vidrohi again for everything and the two hug each other.
The movie ends with Chirag and Bitti getting together, while Vidrohi gets together with Rama. The narrator asks the viewers to taste the famous ‘barfi’ if they ever visit Bareilly.