Guerrazzi was born in the seaport of Livorno, then part of the Grand Duchy of Tuscany. He studied law at the university of Pisa, graduating in 1824. He began to practice in Livorno, but soon gave up law in favour of politics and literature, being particularly influenced by Byron, to whom he dedicated his "Stanze" (1825). His first novel, La Battaglia di Benevento was published in 1827.
Giuseppe Mazzini made his acquaintance, and in 1829, together with Carlo Bini, they started a newspaper, L'Indicatore Livornese, at Livorno. The authorities of the Grand Duchy of Tuscany suppressed the periodical in February 1830 after 48 issues.
In the same year Guerrazzi was banished to Montepulciano for six months after writing an oration to the memory of Cosimo Del Fante — a native of Livorno who had embraced the ideals of the French Revolution and whom Guerrazzi held up as an example for the idealists of the risorgimento. While confined to Montepulciano he began work on his most famous novel, L'Assedio di Firenze - based on and greatly glorifying the life of the 16th Century Florentine soldier Francesco Ferruccio.