Hillary Clinton has criticised the "heavily misogynistic" atmosphere online which has seen female candidates not stand in the general election.
The former US secretary of state spoke at Swansea University on Friday, talking about issues faced by women.
Mrs Clinton said social media culture was serving the "amplification of hatred" which led to the "political assassination" of Labour MP Jo Cox.
She also said President Donald Trump was a "24/7 bully".
Mrs Clinton's grandparents are Welsh, and the university named its law school the Hillary Rodham Clinton School of Law in 2017.
She returned to the city to lead a discussion panel, discussing adversity faced by women,
"Unfortunately, the atmosphere online is heavily misogynistic because apparently the people, and it's predominantly, though not exclusively, men who spend their time going after women of prominence in whatever field they are in and just can't let it go," Mrs Clinton said.
She added that what is said "is often vile".
"When I was in London over the last few days, a number of people told me about women not standing for Parliament this time because of the threats they have received," Mrs Clinton went on.
"And it's really particular to them. Threats of death and terrible attacks, including going after their families, in particular mentioning their children."
Mrs Clinton said she had spoken to a female politician who had decided she was not going to stand for the 12 December general election, telling her: "I just can't take it".
"It is a terrible loss and a loss to democracy if anybody is intimidated out of running, and disproportionately the people choosing not to run in the first instance or for re-election are women," she said.
"All kinds of hatred and bias has been with us from the beginning of time. That is no surprise, but something about the amplification of the hatred attracts even more people.
"And of course I can't help but think about Jo Cox, who was the target and victim of a political assassination."
When asked if discussing the issues made her want a return to politics, Mrs Clinton said: "No, but it makes me more determined to support women like those on this panel and to speak out."
The former Democratic presidential nominee said there had been "an explosion of bullying in American schools" and that "much of it is inspired by the behaviour of our president, who is a, as you know, 24/7 bully on all kinds of issues".
"That is the highest office in our land and that is the role model of our children. The children are picking up on those cues," she added.