Ramanujam Iyengar alias Ambi is an orthodox Brahmin and a straightforward consumer protection advocate living in Triplicane, Chennai. He expects everyone to follow the law and prosecutes those who violate it. However, his efforts fail as circumstantial evidence always seems to favour the accused. He also fails to raise civic awareness due to pervasive corruption and a general lack of seriousness. Frustrated at his inability to bring about a change in society, his suppressed anger manifests itself in an alter-ego named Anniyan, a grim reaper-themed serial killer who punishes corrupt and indifferent people. Anniyan creates a website, compiles a list of wrongdoers from his site, and kills them using punishments described in the Garuda Puranam, one of the ancient Hindu scriptures.
Ambi is secretly in love with his neighbour Nandini, an aspiring carnatic singer, but never expresses his love due to his fear of rejection. When he proposes to her during the annual Tyagaraja Aradhana at Thiruvaiyaru, she rejects him as she cannot bear his strict adherence to rules. Distraught, Ambi attempts suicide, almost drowning himself before having second thoughts. Subsequently, he develops another personality named Remo, a fashion model. Nandini is smitten by Remo and falls in love with him. Their marriage is eventually fixed.
While purchasing a plot of land for her dowry, Nandini decides to undervalue the property to evade stamp duty. Ambi, who accompanies her as she registered the property, refuses to help her. Later, when Nandini and Remo are on a date, Remo transforms into Anniyan and attempts to punish her for her corrupt act. As he is about to kill her, Nandini calls out for Ambi. Anniyan then reverts to Ambi, who collapses and loses consciousness. Nandini takes Ambi to NIMHANS where he is diagnosed with multiple personality disorder. Through recovered-memory therapy, the chief psychiatrist of the hospital uncovers Ambi's past. It is revealed that, when Ambi was fourteen years old, he witnessed the accidental death of his younger sister Vidya due to civic apathy. The incident left a deep emotional scar, which is the reason for his lofty ideals. It is also discovered that while Anniyan and Remo are aware of Ambi as a separate person, Ambi is oblivious to their existence within him. The psychiatrist declares that Remo will cease to exist if Nandini accepts Ambi's love, but Anniyan will cease to exist only when the society reforms. Nandini accepts Ambi's love and Remo disappears.
Meanwhile, DCP Prabhakar and Sub-inspector Chari, who is Ambi's friend, investigate the murders committed by Anniyan. In disguises, they discover clues left behind by Anniyan, which are the names of the punishments he meted out to his victims. Prabhakar is determined to bring Anniyan to justice as one of Anniyan's victims, Chockalingam, an errant catering contractor with the Indian Railways, was his elder brother. In a dramatic publicity stunt, Anniyan admits to the murders he committed when he appears amidst the public and the press at the Nehru Stadium. He explains the rationale behind them and says that only when every Indian is responsible and sincere will the country prosper on a par with developed nations. His methods draw both praise and criticism. Prabhakar tries to catch Anniyan, but he escapes.
On investigating the recorded footage, Prabhakar discovers that Anniyan is Ambi and arrests him. Ambi is brutally interrogated and almost killed, triggering Anniyan's reappearance. Ambi's personality alternates between Ambi and Anniyan, resulting in ambiguity. He subdues Prabhakar as Anniyan, but begs for mercy as Ambi. Using CCTV, Chari secretly records the interrogation and uses it as evidence of Ambi's condition during his trial. Ambi is sentenced to psychotherapy in a mental hospital and will be eligible for release when cured.
When Ambi is released two years later, his rigid adherence to protocol has diminished. He marries Nandini. While travelling on a train during their honeymoon, he notices a man (an electrician who was indirectly responsible for his sister's death several years ago) drinking amidst fellow passengers. Suffering a relapse, he transforms into Anniyan and throws the man off the train, killing him. However, he hides the incident from Nandini, indicating that he has successfully blended his personalities into one instead of eradicating them.