O'Hanlon was born on 8 October 1965 in Carrickmacross, County Monaghan, the son of Fianna Fáil TD and physician Rory O'Hanlon and Teresa (née Ward). He is the third of six children, and has three brothers and two sisters. The episode of "Who Do You Think You Are?" which aired on 6 October 2008 revealed that O'Hanlon's paternal grandfather, Michael O'Hanlon, was a medical student at University College Dublin who had joined the Irish Republican Army (IRA) during the Irish War of Independence and was a member of Michael Collins's Squad, which assassinated British secret service agents on the morning of Bloody Sunday. Details of his grandfather's activities survive in UCD Archives, as well as Blackrock College. It also transpired that, on his mother's side, he is a close relative of Peter Fenelon Collier.