Hanfi was born on November 17, 1938, in Sultanpur. He graduated from Allahabad University and Aligarh Muslim University after which he joined the academia. He first taught at the Aligarh Muslim University but later joined the Jamia Millia Islamia in New Delhi. He remained connected to the institution in the capacity of professor emeritus.
He was famous for his literary contributions to the Urdu language, including writing plays, poetry, and critique. He translated Abul Kalam Azad's book India Wins Freedom, while some of his own bestselling books include Manto Haqiqat se Afsaane Tak, Jaadeediyat Ki Falsafyana Asas, Nayi Sheri Riwayat, Tareekh, Tehzeeb aur Takhleequi Tajurba, Urdu Culture aur Taqseem ki Riwayat, Khayal ki Musaafat and Qari Say Mukalma.
His poetry collection Aakhiri Pehar ki Dastak was published by Rekhta, one of its first ventures in publishing, in 2015.
Hanfi was born in Sultanpur in Uttar Pradesh to Mohd Yaseen Siddiqui, an advocate, and Begum Zaibunnisa. He was the eldest of six siblings. His father was also a literary enthusiast and introduced Hanfi to Tagore, Dostoyevsky, Dickens and others, quite early in life.
At Allahabad University, he came in contact with Firaq Gorukhpuri, Dr Aijaz Hussain, Prof Ehtesham Hussain and Prof SC Deb, who left an indelible impact upon his sensibilities. He completed his DPhil from Allahabad University in 1966. He was also the first regular student of DLit at Aligarh Muslim University, which he completed in 1976.