Lizardi was born in Mexico City to professional-class parents of moderate means, his mother the daughter of a Puebla bookseller and his father a physician who for some time supported his family by writing. His father's illness in 1798 and subsequent death forced young Lizardi to leave his studies in the Colegio de San Ildefonso at the University of Mexico, and to enter the civil service as a minor magistrate in the Taxco-Acapulco region. He married there in 1805, and the necessity of providing for a growing family led him to supplement his meager income by writing.
Lizardi began his literary career in 1808 with the publication of a poem in honor of Fernando VII — a patriotic stance for a Mexican intellectual to take in the year of the Napoleonic invasion of Spain, and one in line with Lizardi's later proto-nationalist views. At the beginning of Mexico's wars of independence in November 1810, Morelos's insurgent forces fought their way into Taxco, where Lizardi was heading the local government as acting subdelegado. In the face of an initial insurgent victory, Lizardi appears to have played both sides. On the one hand, he received the insurgents as friends and turned over the city's armory to them; on the other, he informed the viceroyalty of rebel movements. Judged in the context of his later writings, his actions do not appear hypocritical: he was always supportive of the intellectual aims and reformist politics of the insurgents, but was equally opposed to war and bloodshed. By peacefully capitulating he aimed, above all, to avoid loss of life in the city then under his command. Following the royalist recapture of Taxco in January 1811, Lizardi was taken prisoner as a rebel sympathizer and sent with the other prisoners of war to Mexico City. There he appealed successfully to the viceroy, arguing that he had acted only to protect Taxco and its citizens from harm.
Though freed, Lizardi lost his position and his confiscated goods. To support his family, now living in the colonial capital, it appears that he turned to literature. Over the following year he published more than twenty lightly satirical poems in broadsheets and pamphlets. Then, on 5 October 1812, the footdragging colonial authorities finally published the decree by which the liberal Cortes of Cádiz had established a limited freedom of the press in Spain and its empire some two years earlier. Lizardi jumped at the opportunity that had suddenly opened, and a mere four days later the first issue of his periodical El Pensador Mexicano ("The Mexican Thinker," a title he adopted as his own pseudonym) appeared.
In his periodical work Lizardi turned from light social criticism to direct commentary on the political problems of the day, with attacks on the autocratic tendencies of the viceregal government and support for the liberal aspirations represented by the Cortes in Spain. His articles clearly demonstrate the hold that Enlightenment ideas, derived from clandestine readings of the forbidden Voltaire, Rousseau, and Diderot, had on his imagination. These ideas would later achieve novelistic form in El Periquillo Sarniento; but first they were to land Lizardi in prison.
The ninth issue of the paper, in December 1812, contained a direct attack on the viceroy; the result was arrest and detention for Lizardi. He continued to issue El Pensador Mexicano even from prison, but to the dismay of his pro-independence followers he suppressed his sympathies for the insurgents, muted his critiques of the system that had imprisoned him, and even published lavish praises of a new viceroy who he hoped (correctly) would free him after seven months in his cell. Lizardi continued to write and publish his periodicals for the next two years, though increased attention from royalist censors and the Inquisition still muted his critical tone.
After the Spanish Cortes were overthrown in 1814, and with them the liberal constitution and the freedom of the press they had proclaimed, Lizardi turned from journalism to literature as a means of expressing his social criticism. This social and political conjuncture, then, was the genesis of Lizardi's first novel, which is commonly recognized as the first Mexican and indeed the first Latin American novel. Like Lizardi's periodicals, the publication of El Periquillo (issued in installments throughout 1816) was eventually halted by censorship. The first three volumes slipped past the censor, as Lizardi had hoped they would in their fictionalized guise, but Lizardi's direct attack on the institution of slavery in the fourth volume was enough to have the publication stopped. The fourth volume of El Periquillo thus was only published in 1831, four after Lizardi's death and a decade following Mexican independence. Lizardi's other works of fiction appeared, also by installments, during the years of renewed royalist repression that lasted until 1820: Fábulas (a collection of "fables," 1817), Noches tristes (novel, 1818), La Quijotita y su prima (novel, 1818-19), and Don Catrín de la Fachenda (completed 1820, published 1832).
With the re-establishment of the liberal constitution in 1820, Lizardi returned to journalism, only to be attacked, imprisoned, and censored again — by royalists until the independence of Mexico in 1821; by centralists opposed to his federalist leanings after independence; and throughout, by clerics opposed to his Masonic leanings. He died of tuberculosis in 1827 at the age of 50. Because of his family's extreme poverty he was buried in an anonymous grave, without the epitaph he had hoped would be engraved on his tombstone: "Here lie the ashes of the Mexican Thinker, who did the best he could for his country."
Following Lizardi's death, his novels were reissued in complete form, some for the first time, between 1830 and 1832. They have remained in print, in multiple editions, ever since.