Although Gogol was considered by his contemporaries to be one of the preeminent figures of the natural school of Russian literary realism, later critics have found in his work a fundamentally romantic sensibility, with strains of surrealism and the grotesque ("The Nose", "Viy", "The Overcoat", "Nevsky Prospekt"). His early works, such as Evenings on a Farm Near Dikanka, were influenced by his Ukrainian upbringing, Ukrainian culture and folklore. His later writing satirised political corruption in the Russian Empire (The Government Inspector, Dead Souls). The novel Taras Bulba (1835) and the play Marriage (1842), along with the short stories "Diary of a Madman", "The Tale of How Ivan Ivanovich Quarreled with Ivan Nikiforovich", "The Portrait" and "The Carriage", are also among his best-known works.
Gogol was born in the Ukrainian Cossack village of Sorochyntsi, in Poltava Governorate of the Russian Empire, present-day Ukraine. His mother descended from Leonty Kosyarovsky, an officer of the Lubny Regiment in 1710. His father Vasily Gogol-Yanovsky, a descendant of Ukrainian Cossacks (see Lyzohub family) and who died when Gogol was 15 years old, belonged to the 'petty gentry', wrote poetry in Ukrainian and Russian, and was an amateur Ukrainian-language playwright. As was typical of the left-bank Ukrainian gentry of the early nineteenth century, the family spoke Ukrainian as well as Russian. As a child, Gogol helped stage Ukrainian-language plays in his uncle's home theater.
In 1820, Gogol went to a school of higher art in Nezhin (now Nizhyn Gogol State University) and remained there until 1828. It was there that he began writing. He was not popular among his schoolmates, who called him their "mysterious dwarf", but with two or three of them he formed lasting friendships. Very early he developed a dark and secretive disposition, marked by a painful self-consciousness and boundless ambition. Equally early he developed a talent for mimicry, which later made him a matchless reader of his own works and induced him to toy with the idea of becoming an actor.
In 1828, on leaving school, Gogol came to Saint Petersburg, full of vague but glowingly ambitious hopes. He had hoped for literary fame, and brought with him a Romantic poem of German idyllic life – Hans Küchelgarten. He had it published, at his own expense, under the name of "V. Alov." The magazines he sent it to almost universally derided it. He bought all the copies and destroyed them, swearing never to write poetry again.
Gogol was in touch with the "literary aristocracy", had a story published in Anton Delvig's Northern Flowers, was taken up by Vasily Zhukovsky and Pyotr Pletnyov, and (in 1831) was introduced to Pushkin.