Thomas, who came out as gay in 2009, said that he was driven to suicidal thoughts as a result of his diagnosis.
He told the Sunday Mirror: "I've been living with this secret for years. I've felt shame and keeping such a big secret has taken its toll.
"I was in a dark place, feeling suicidal. I thought about driving off a cliff. "
Ian Green, Chief Executive at Terrence Higgins Trust, said: "I’m very proud to call Gareth Thomas a friend. Gareth is proof that an HIV diagnosis shouldn’t stop you from doing anything you want to do – whatever that is. I hope that by speaking publicly about this Gareth will transform attitudes towards HIV that are all too often stuck in the 1980s.
"We’ve made huge medical advances in the fight against HIV that means that people living with HIV like Gareth now live long healthy lives. We can also say without doubt that those and on effective HIV treatment can’t pass on the virus. This is exactly the kind of information Gareth wants to get out there to challenge the stigma that still surrounds this virus.
"Gareth blazed a trail by being the first rugby player to come out as gay and has done so much to encourage inclusion and diversity within the sport. Now he is doing that once again with HIV and taking on the challenge of a lifetime in Ironman Wales to show that this virus doesn’t need to be a barrier when you’re diagnosed and accessing treatment."