Porta was born in Milan to Giuseppe Porta and Violante Gottieri, a merchant family. He studied in Monza until 1792 and then in the Seminario of Milan. In 1796, the Napoleonic Wars pushed Porta to find a job in Venice (where one of his brothers lived) and he remained there until 1799.
From 1804 until his death, Porta worked as government employee, although he would have been pleased to keep on studying. In 1806, he married to Vincenza Prevosti.
He died in Milan in January 1821 from an attack of gout and was buried in the Church of San Gregorio. His tomb was subsequently lost, but his tombstone Is still conserved in the vault of San Gregorio church, in Milan.
Porta began to write poems in 1790, although few of them were published before 1810. In 1804-1805 he worked at a Milanese translation of the Divine Comedy, which he, however, left unfinished. In these years the progressive group that formed round him and called themselves the "Cameretta Portiana" included Giuseppe Bossi, who painted a group portrait of four Amici della Cameretta Portiana.
In 1810, Brindisi de Meneghin all'Ostaria (written for Napoleon's return in Milan) was published. This was one of many works by Porta featuring Meneghino (the traditional commedia dell'arte character representing Milan). His best season began two years later, with Desgrazzi de Giovannin Bongee ("Troubles of Johnny Bolgeri").
His works can be divided into three categories: works against superstition and religious hypocrisy, descriptions of vivid Milanese popular characters, and political works. The first one includes Fraa Zenever ("Brother Juniper", 1813), On Miracol ("A Miracle", 1813), Fraa Diodatt ("Brother Adeodato", 1814), La mia povera nonna la gh'aveva ("My dead granny had...", 1810). His political satires were mainly sonnets, such as Paracar che scappee de Lombardia ("Scarecrows [literally 'milestones', referred to Frenchmen] who are escaping from Lombardy", 1814), E daj con sto chez-nous, ma sanguanon ("And go on with this 'chez-nous', but bloody Heaven...", a satire about French, 1811), Marcanagg i politegh secca ball (1815, "Goddam ballbreaker politicians"), Quand vedessev on pubblegh funzionari ("When I'd see a public officer...", 1812). Porta satirized the upcoming new Milanese aristocracy, too, in La nomina del cappellan (1819, "The chaplain's appointment"), making a parody of the episode of the "vergine cuccia" ("virgin pet-pup") in Il Giorno (Il Mezzogiorno), by Giuseppe Parini (a satire itself).
His best works are probably those portraying the Milanese popular life, with the collections Olter desgrazzi de Giovannin Bongee ("Other Troubles of Johnny Bolgeri", 1814), El lament del Marchionn di gamb avert ("The Lament of Melchior the Crippled", 1816) and what is generally considered his masterwork, La Ninetta del Verzee ("Little Nina, from Greens Market", 1815), a meaningful and heartbreaking monologue/confession of a prostitute. In 1816 Porta joined the Romantic literarian movement (Sonettin col covon, "Little sonnet, with a big tail"), obviously in his own way: in the very last strophe, he called himself a dumb, meaning instead the opposite. But see the following issue.
It was in honor of Carlo Porta that Alessandro Manzoni, the father of the contemporary Italian language, wrote his only poem in the Lombard language, namely: On badee ch’el voeur fà de sapientôn / el se toeu subet via per on badee; / ma on omm de coo ch’el voeur parè minciôn / el se mett anca luu in d'on bell cuntee. (A stupid wishing to pose as a clever man / is seen to be a stupid right away; / but a clever man posing as a stupid / is in a nice fix himself as well.)
- Isella, Dante (1982). "Carlo Porta". In Emilio Checchi and Natalino Sapegno. Storia della Letteratura Italiana. VII. Milan: Garzanti.