 Ansari did his schooling from St. Edward's School, Shimla.After graduating from St. Xavier's College, Calcutta, affiliated to the University of Calcutta, he pursued his Master of Arts and Doctor of Philosophy degree from the Aligarh Muslim University.He is married to Salma Ansari, fathering two sons and one daughter.