Diary of a Madman centres on the life of Poprishchin, a low-ranking civil servant and titular counsellor who yearns to be noticed by a beautiful woman, the daughter of a senior official, with whom he has fallen in love. His diary records his gradual slide into insanity. As his madness deepens, he begins to suspect two dogs of having a love affair and believes he has discovered letters sent between them. Finally, he begins to believe himself to be the heir to the throne of Spain. When he is hauled off and maltreated in the asylum, the madman believes he is taking part in a strange coronation to the Spanish throne. Only in his madness does the lowly anti-hero attain greatness. As he said in his first sight of her, just after being a beast of a civil servant himself, “A footman opened the carriage door and out she fluttered, just like a little bird.”
The story satirizes the rampant petty officialdom of the bureaucracy in the 1830s in St Petersburg, and some have interpreted it as going beyond this to become an allegory about the political state of Russia at the time, revealing Gogol's view of the government from the standpoint of a lowly citizen. The story also portrays the average man's quest for individuality in a seemingly indifferent, urban city.