During the era of British India, lives a happy go lucky, school drop-out Shivkar Bapuji Talpade aka Shivi (Ayushmann Khurrana), who falls in love with a local stage dancer Sitara (Pallavi Sharda). This makes Shivi's father throw him out of the house and he bumps into a crazy scientist Pandit Subbaraya Shastri (Mithun Chakraborty). Shastri is constantly being chased by British soldiers for his weird experiments but lesser they know that Shastri is secretly building a flying machine. Seeing Shivi's great knowledge of Vedas, Shastri shares his secret book based on ancient Indian aeronautics, which he is using to build an aeroplane. Shastri offers Shivi to be his assistant but Shivi refuses. Shivi later proposes to Sitara to marry her, but Sitara resists on the grounds that society will not accept their marriage and goes away to Hyderabad.
Heartbroken, Shivi goes back to Shastri and accepts his offer to assist him. Together they work for several months to design a perfect machine which can fly but kept failing. On running out of funds they request a local king to sponsor their experiments. Finally, they manage to build a small aeroplane and have a successful unmanned test flight in presence of many eyewitnesses, but it crashes within a few seconds. Shivi later learns that Sitara is back in Bombay and now lives in a poor condition under heavy debts. Shivi and Sitara reunite, but in order to get her out of debt, Shivi sells Shastri's secret book to a British officer. Feeling betrayed, Shastri does not survive this trauma and dies. Shastri's death makes Shivi feel so guilty, that he decides to fulfil Shastri's incomplete dream along with Sitara and his nephew Narayan.
In his quest to build a perfect flying machine, Shivi goes to Banaras to meet a guru, to whom Shastri used to refer. The guru gives Shivi a code "4121", which later helps Shivi figure out that mercury will be the best fuel for the engine, since the word "mercury", when written in Hindi in terms of chemistry, looks like the number 4121. Before Shivi can complete his machine, British officers arrest him on his brother's complaint. After being rescued by a freedom fighter, Shivi finally takes the aircraft to sea beach. In the end, before soldiers can arrest him again, Shivi flies away with Sitara and they become the world's first humans to ride in a flying machine.