Both were war heroes -- Kennedy in World War Two and Kerry in the Vietnam War. Both are from prominent Catholic families in Massachusetts. And both have the same initials, JFK.
The Democratic frontrunner has been surprised to learn, however, that his ancestors were from a different part of Europe.
A genealogist hired by an American newspaper last summer discovered that the Massachusetts senator's paternal grandfather -- whom he knew as Frederick Kerry, a devout Catholic -- was born an ethnic German Jew named Fritz Kohn in a small mountain town in what is now the Czech Republic.
At the time of Kohn's birth in 1873, the area was part of the Austro-Hungarian Empire and largely inhabited by Germans who knew the town -- now called Horni Benesov -- as Bennisch.
Now Kerry has delighted the inhabitants of Horni Benesov by promising to visit the town if he wins the presidential contest in November.
The town’s residents are now following Kerry's progress with as much fervor as they do the scores of the local ice hockey team. The town's amateur soccer team has even renamed itself the "John Kerry Team."
Josef Klech, the mayor of Horni Benesov, says he has already sent a message to Kerry.
"We have contacted John Kerry once, a year ago, when his presidential candidacy as one of 10 candidates from the Democratic Party was made public."
Mayor Klech said everyone in Horni Benesov was proud and happy that Kerry's grandfather hailed from the town.
"We sent him an e-mail in which we wrote that we know his family roots are from here, Horni Benesov, and we have congratulated him on his candidacy. We expressed our confidence that he will win the presidential election and told him we are keeping our fingers crossed [for good luck].”
Horni Benesov is an isolated town made more so in wintertime by heavy snows, which make treacherous the roads winding up into the foothills of the Jeseniky Mountains near the border with Poland.
The town, some 250 kilometers east of the Czech capital, Prague, thrived as a mining and textile center when the Kohn family of brewers lived there in the 19th century.
But in 1992, the mine shut, suddenly removing the biggest source of work for the town's 2450 inhabitants -- a blow Horni Benesov has yet to recover from.
A tall church spire and houses with fancy but crumbling facades clustered around the town square hint at the town's former affluence. But even a thick layer of snow cannot hide the decay brought on by years of communist neglect and capitalist transformation.
Klech says there are few records about the Kohns or any of the town's ethnic German population, who were ultimately expelled at the end of the Second World War as supporters of the Nazi invaders of what was then Czechoslovakia.
The Kohn family house has been leveled; the site is now a school playing field.
Sparse records from the time provide only a few details of Fritz Kohn's early years. He left Bennisch for Vienna and is believed to have married Ida Lowe, a Hungarian Jew, around the turn of the century.
In 1902 they converted to Catholicism and Kohn adopted the name Frederick Kerry. The couple emigrated to the United States two years later.
They first settled in Chicago, and later moved to Boston, where John Kerry's father, Richard, was born in 1915. In 1921, beset by financial problems, Frederick Kerry committed suicide in a Boston hotel.
There is no remaining trace of Kohn descendants in Horni Benesov. But that has not prevented the town from claiming John Kerry as one of their own. Locals say they hope Kerry will secure his party's nomination and go on to take the presidency.
Mayor Klech says a visit from a future President Kerry would help put Horni Benesov on the map again, helping to draw the attention of Czech authorities to the town's economic plight.
The mayor says Horni Benesov will make Kerry an honorary citizen if he does visit.
"He announced three weeks ago on American television that he will visit Horni Benesov and the Czech Republic if he becomes the American president. Only at that point will we -- or I personally, via the municipal council -- initiate giving him free rein of the town. And we will place a memorial plaque at the site of the house in which his grandfather was born," Klech said.
Now other parts of Central Europe are keen to claim ties to Kerry. Authorities in Vienna say the building where Fritz Kohn lived is still standing. Hungarian media is focusing on connections to Kerry's grandmother, Ida.
Kerry is not the first prominent Democrat with roots in what is now the Czech Republic. The secretary of state during the presidency of Bill Clinton, Madeleine Albright, was also born in former Czechoslovakia.
Albright, who speaks fluent Czech, is revered in the Czech Republic and has even been asked to run for the Czech presidency.
Another Central European who has risen high in American politics recently is Austrian-born actor Arnold Schwarzenegger, who was best known for his Terminator movies before becoming governor of the U.S. state of California last year.