To was born in Hong Kong in 1963. He was educated at the Church of Christ in China Kei Wa Primary School and Wah Yan College, Kowloon before he was enrolled to the University of Hong Kong where he graduated with a law degree, LL.B. in 1985 and PCLL in 1986, and became a lawyer after graduation.
He was involved in the local democracy movement in support of the Tiananmen protests of 1989. In 1990, he co-founded the United Democrats of Hong Kong, the first major pro-democracy party in Hong Kong later transformed into the Democratic Party. He was first elected to the Sham Shui Po District Board in 1991 in Cheung Sha Wan.
To ran in the first direct elections of the Legislative Council of Hong Kong in 1991, where he was elected with Frederick Fung of another pro-democracy party Association for Democracy and People's Livelihood (ADPL) in Kowloon West. He was Hong Kong's youngest legislator at the age of 28 when first elected. He kept his record until 2016 when Nathan Law of Demosisto was elected at the age of 23.
He was re-elected in the 1995 Legislative Council election with 69 percent of the popular vote in his Kowloon Southwest constituency. He served on the Legislative Council until 30 June 1997 at the eve of the handover of Hong Kong when he had to step down with his party and replaced by the Provisional Legislative Council.
He ran again the first SAR Legislative Council election in 1998 he was re-elected with Lau Chin-shek on the same ticket with 55 percent of the popular vote in Kowloon West. He has specialised in the security issues, having been the party's spokesman on security issue chaired the Panel on Security, one of the key committees in the Legislative Council. He had closely followed the works of the Independent Commission Against Corruption, immigration issues, Vietnamese refugees, crime and triads. He also campaigned for the setup of the Independent Police Complaints Commission against police abuses of power. Due to his Christian belief, he was known for his anti-gay rights voting records despite his liberal political affiliation.
He was re-elected in Kowloon West in 2000, 2004 and 2008. In June 2010, he expressed open scepticism of the Democratic Party's support for the government's 2012 constitutional reform package but nevertheless toed the party line and voted for the measure. The party had secured the inclusion of a late amendment to hold a popular vote for five new District Council functional constituencies. In a dissenting speech to Legco, he warned of the creation of "super-functional constituencies" with an apparently larger mandate than that of geographical constituency lawmakers.
In the 2012 Legislative Council election, he represented the party to run in the newly created territory-wide District Council (Second) constituency. His ticket received 316,468 votes in total, the largest votes in the electoral history of Hong Kong until it was exceeded by his party colleague Kwong Chun-yu in 2016.
In 2016, he was re-elected in the District Council (Second) constituency with a sharp decline of vote due the strategic voting of the pro-democracy voters who turned to vote for Kwong Chun-yu who was trailing behind To. As a result, To took the marginal seat with 243,930 votes, only 10,694 votes, 0.6 per cent higher than the unelected pro-Beijing candidate Wong Kwok-hing of the Hong Kong Federation of Trade Unions.
He became the most senior member of the Legislative Council, after Albert Ho retired from the legislature and Lee Cheuk-yan was surprisingly unseated, and became the last Legislative Council member from the "Class of 91", first elected in the first Legislative Council direct election in 1991. He also became the only legislator who has been directly elected in all elections since 1991. In October 2016, he became the convenor of the reorganised pro-democracy caucus.
In January 2008, To divorced his wife, Cherry Yuen Choi-lin, over her alleged extramarital affairs. They did not have any children. On 12 December 2009, he married his second wife, Sue So. The couple have a son since 2012.