The US has a profound interest in a "strong UK staying in a strong European Union", says the US Secretary of State.
John Kerry said many Europeans felt "overwhelmed" by recent challenges but the US was confident Europe would "emerge stronger".
His comments in Munich come ahead of a crucial Brussels summit, where Prime Minister David Cameron is hoping to secure a deal on a reformed EU.
An EU-exit group said the US stance on Britain leaving was "for US interests".
Mr Cameron, who was also in Germany, said changes he was seeking to UK membership would make Europe "more outward-looking, competitive and dynamic".
He hopes to secure a package that he can recommend to the British public, ahead of a referendum on whether the UK should stay in or leave the EU.
Mr Kerry, who spoke about the EU while at security conference in Munich, said Europe was facing a number of challenges including the UK's potential exit.
"Here again however, I want to express the confidence of President Obama and all of us in America that, just as it has so many times before, Europe is going to emerge stronger than ever, provided it stays united and builds common responses to these challenges," he said.
"Now obviously, the United States has a profound interest in your success as we do in a very strong United Kingdom staying in a strong EU."
Last year, US President Barack Obama said the UK must stay in the EU to continue to have influence on the world stage.
A spokesman for Vote Leave, one of two groups vying to be the official Out campaign in the EU referendum, told the BBC the British government was "pulling favours" from world leaders.
"The State Department has long thought the UK is better off in for US interests," he said.
"But this vote is about the future of the British people and Britain's best interests and we're confident the British people will vote to take that control."
However, Britain Stronger In Europe - a group campaigning for Britain to remain in the EU - said Mr Kerry's comments reinforce how Britain's "global influence is clearly enhanced by staying in Europe".
Executive director Will Straw said: "Being in an alliance with 27 other European democracies strengthens our hand when dealing with threats like terrorism and a resurgent Russia. And increases our clout and credibility in Washington."
In a speech to business, political and civic leaders in Hamburg, Mr Cameron said he would campaign "unequivocally" for the UK to stay in - if the EU agreed to the new terms of membership.
While defending Britain's right to protect its sovereignty, he told his audience - which included German Chancellor Angela Merkel - that Britain was an "open nation" and he "never wants us to pull up the drawbridge and retreat from the world".
"So when it comes to the question of Britain's future in Europe, my aim is clear," he said. "I want to keep Britain inside a reformed European Union."
Mr Cameron also appealed for Germany's help in finalising reforms, stressing the countries' shared interests and values.
Negotiations on the final wording of the deal - which includes an "emergency brake" on benefit payments to EU migrants and a UK opt-out from "ever closer union" - look set to carry on right up to the start of the Brussels summit on 18 February.
Campaigners for an EU exit have said the draft deal, published earlier this month after months of negotiations between UK and EU officials, did not come close to the changes voters had been promised.
No date has yet been announced for the referendum although Downing Street is reported to favour staging the poll in June.
Further reading on the UK's EU referendum
EU renegotiation: Did Cameron get what he wanted?
Referendum timeline: What will happen when?
The view from Europe: What's in it for the others?