2017–2020: Established actor
After no releases in 2016, he starred in the poorly received Meri Pyaari Bindu opposite Parineeti Chopra, Khurrana's career progressed with his two other films releases of 2017, the romantic-comedy dramas Bareilly Ki Barfi and Shubh Mangal Saavdhan, both of which were commercially successful. Adapted from Nicolas Barreau's French novel The Ingredients of Love, the former starred him alongside Rajkummar Rao and Kriti Sanon as a writer who gets involved in a love triangle with a tomboyish girl and a timid salesman. Saibal Chatterjee of NDTV wrote that Khurrana does a "convincing job of mutating from a brooding jilted lover to a crooked manipulator who puts his own interests above everyone else's". In the latter, he starred opposite Pednekar as a newly engaged man suffering from erectile dysfunction. A remake of the Tamil film Kalyana Samayal Saadham (2013), the film, Khurrana hoped, had a humorous take on mental and sexual problems faced by men which would bring wider attention to the topic. Rajeev Masand took note of how well the film handled sexuality without being crude and commended him for "investing the fellow with genuine likeability and an understated charm". Khurrana received a nomination for the Filmfare Award for Best Actor for the latter film.
2018 featured Khurrana in two of the highest-grossing Hindi films of the year, both of which won National Film Awards. His first role was in Sriram Raghavan's Andhadhun, a thriller co-starring Tabu and Radhika Apte, in which he played a blind pianist who unwillingly becomes embroiled in a murder. He lobbied for the part after hearing about it from casting director Mukesh Chhabra, and in preparation, learnt how to play the piano and interacted with blind piano players. Udita Jhunjhunwala of Mint praised Khurrana for giving a "taut performance that balances vulnerability with craftiness" and Ankur Pathak of HuffPost found his to be "a layered, no-holds-barred performance worth applauding". Andhadhun earned ₹4.56 billion (US$49 million) worldwide, a majority of which came from the Chinese box office, to become Khurrana's highest-grossing release and one of Indian cinema's biggest grossers. He next starred in Badhaai Ho, a comedy from director Amit Ravindernath Sharma about a young man whose middle-aged mother gets pregnant. Anna M. M. Vetticad of Firstpost considered his performance to be "completely convincing" and commended him for choosing "to work in small films where the star is the story". A surprise blockbuster, it earned over ₹2.21 billion (US$24 million) worldwide. For Andhadhun, Khurrana won the National Film Award for Best Actor and Filmfare Critics Award for Best Actor.
The series of huge successful and blockbuster films continued with Khurrana's 2019 releases: Article 15, Dream Girl, and Bala. The first was a crime thriller directed by Anubhav Sinha in which he played a righteous police officer solving a rape case. Highlighting caste discrimination in India, the film was inspired by multiple events including the 2014 Badaun gang rape allegations and the 2016 Una flogging incident. It was his first dark and intense character in his film career. Writing for The Guardian, Wendy Ide commended him for "combin[ing] soulful Bollywood heartthrob charisma with an arrestingly intense performance." Dream Girl starred him as a cross-gender actor who speaks in a female voice while working at a call centre which unwittingly attracts male attention. Nandini Ramnath of Scroll.in considered his "manic energy and believable Everyman persona" to be the film's highlight. The lattermost was a satire on societal standards of beauty from director Amar Kaushik, in which he played a young man who faces societal pressure due to premature balding. He found it physically challenging to play the part due to the heavy layers of prosthetics used on his head. It marked his second film where he did not sing any of the songs. Rajeev Masand opined that Khurrana "cuts a sympathetic figure as another not-instantly-likeable loser" and added that he had "cornered the market when it comes to playing flawed, insecure men with confidence issues". He won another Filmfare Critics Award for Best Actor for Article 15 and received a Best Actor nomination at the ceremony for Bala. That year, he reappeared on Forbes India's Celebrity 100 list, ranking 37th with an estimated annual income of ₹305 million (US$3.3 million).
For his next project, Khurrana actively looked for another mainstream film that would portray sexuality in a humorous manner. He found it in Shubh Mangal Zyada Saavdhan (2020), in which he played a gay man who has trouble convincing his partner's family of their relationship. It was the first mainstream Bollywood film to be led by openly gay characters. Shubhra Gupta of The Indian Express credited Khurrana for "allowing the film to be so much about" his lesser known co-star Jitendra Kumar. The film performed moderately well at the box-office, despite being impacted by the shutdown of cinemas due to the COVID-19 pandemic in India. He was next seen in the comedy-drama Gulabo Sitabo, directed by Sircar and co-starring Amitabh Bachchan. Due to the pandemic, the film premiered directly on Amazon Prime Video. Pallabi Dey Puryakastha of The Times of India noted that Khurrana's "body language tellingly portrays sadness and bitterness borne out of poverty".