In an online meeting with anti-vaccine activists on June 27, Robert F. Kennedy Jr., a Democrat running for president, falsely said there was good evidence that vaccine research had caused millions of deaths during the 1918 Spanish flu epidemic. He also claimed that such research could have created Covid-19, H.I.V. and other deadly viruses.

But in an appearance before Congress on July 20, Mr. Kennedy made none of those assertions. When lawmakers asked him about vaccines, he said: “I have never been anti-vax. I have never told the public to avoid vaccination.”

Even as Mr. Kennedy is a long shot for the Democratic nomination, he remains a case study of how a political figure can spread falsehoods and conspiracy theories at a large scale. And since he declared his presidential run in April, a gulf has appeared between what he says at political and campaign events and what he says on podcasts, at events and on shows that cater to anti-vaccine activists and conspiracy theorists, according to a review of his comments by The New York Times.

In large public forums like Congress, Mr. Kennedy, 69, has moderated his extreme views, while continuing to advocate them in other settings. At campaign stops in Iowa, Vermont and Virginia this summer, he spoke about the environment, foreign policy and the war in Ukraine, according to The Times’s review. He did not mention vaccines and limited his comments on Covid to criticism of pandemic lockdowns.

Yet during that same period, Mr. Kennedy appeared on more than two dozen podcasts hosted by personalities popular with the right wing, such as Jordan Peterson and Joe Rogan, as well as in online meetings and video streams where he brought up a variety of fringe ideas. At times, he made unfounded claims about vaccines and questioned whether chemicals in the water supply were causing “sexual dysphoria” among children in the United States.

The shift in Mr. Kennedy’s behavior is stark after his nearly two decades of promoting unsubstantiated theories about vaccines and other matters. Misinformation researchers said the candidate had probably tempered his most extreme positions to appeal to a wider audience and win over voters.

“If you only hear what he says in those big, open forums, you might think this is a reasonable, moderate person I want to support — and that is the point,” said Kolina Koltai, a misinformation researcher who has studied anti-vaccine conspiracy theories. “He is making himself mainstream.”

When Mr. Kennedy raises topics that he has extreme views on, he now does so more subtly, Ms. Koltai said. In campaign forums, he often poses his ideas about vaccines as questions, such as asking if coronavirus vaccines were produced too quickly or questioning the safety protocols around other vaccines, she said.

Mr. Kennedy’s campaign did not respond to requests for comment, but previously said in a statement to CNN that the candidate was being “mischaracterized.”

Recent opinion polls suggest that Mr. Kennedy, a scion of the Kennedy family and an environmental lawyer and activist, has the support of around 12 percent of Democratic voters. He has attracted some high-profile backers, including Elon Musk, the Twitter founder Jack Dorsey, the National Football League star Aaron Rodgers and the actress Alicia Silverstone.

Mr. Kennedy’s public work against vaccines began in 2005, when he published articles in Rolling Stone and Salon claiming a link between vaccines and autism. The news outlets later withdrew the articles. In 2018, he founded Children’s Health Defense, a nonprofit in Washington that has promoted anti-vaccine ideology.

During the coronavirus pandemic, Mr. Kennedy spoke at dozens of events where he claimed that the drugs ivermectin and hydroxychloroquine could help treat Covid. Numerous studies published during and after the pandemic have found otherwise. Mr. Kennedy has not addressed those studies.

Mr. Kennedy also produced a 2021 movie that suggested Black Americans should not get vaccinated, even as health officials said such claims were dangerous. And he wrote a book claiming that Dr. Anthony S. Fauci, President Biden’s top medical adviser for the pandemic, and Bill Gates, a founder of Microsoft, conspired with drug companies to profit from vaccines. Dr. Fauci and Mr. Gates have rebutted the claims.

In 2021, the Center for Countering Digital Hate, a nonprofit that conducts research on social media, named Mr. Kennedy as one of the “Disinformation Dozen,” which it called the top 12 superspreaders of misinformation about Covid on the internet.

Mr. Kennedy has also used his platform to promote other misleading ideas, including that 5G networks are being used for mass surveillance.

“You have a bleeding-over from vaccines to broad conspiratorial ideas on a number of topics,” said Jonathan Jarry, a scientist and science communicator with McGill University’s Office for Science and Society. “He promotes a whole worldview that is not just about opposing vaccines — it is about distrust of government, media and other bodies, while promoting trust in him.”

When Mr. Kennedy said he was running for president, his behavior shifted immediately. In a nearly two-hour speech announcing his candidacy, he did not mention vaccines or promote conspiracy theories.

“My mission over the next 18 months of this campaign and throughout my presidency will be to end the corrupt merger of state and corporate power,” he said, going on to criticize government spending, corporate power and pandemic lockdowns.

In campaign appearances over the summer, Mr. Kennedy was circumspect. During a June 5 audio event with Mr. Musk on X, the service formerly known as Twitter, Mr. Kennedy made a passing reference to vaccines and limited his remarks to the difficulties that people faced during the lockdowns.

He similarly skirted mentioned of vaccines when he campaigned in June in Vermont and at last month’s Iowa State Fair, a popular stomping ground for presidential candidates. In an interview with Mr. Kennedy that was posted on Aug. 14, Tucker Carlson opened by noting that it would make no mention of vaccines.

At the same time, Mr. Kennedy espoused extreme views on podcasts. In June, he told Mr. Peterson, a psychologist and an author, that chemicals in the water supply could turn children transgender. That same month, Mr. Kennedy appeared on Mr. Rogan’s podcast and presented false or unfounded claims, including that aluminum in vaccines causes autism and that Wi-Fi causes chronic illness.

Late last month, Children’s Health Defense announced a “people’s bus tour” across the United States to collect stories from people who were harmed by vaccinations and other health protocols introduced during the pandemic. The side of the bus was emblazoned with “Vax-Unvax,” the title of Mr. Kennedy’s new book.