Writing ahead of a membership referendum on June 23, the retired military chiefs said the EU helped protect the country against threats from Islamic State (IS) jihadists and Russia.
The signatories of the letter to the Daily Telegraph newspaper include four former professional heads of the overall armed forces as well as two former heads of the army and two of the navy.
"Will Britain be safer inside the EU or outside it? When we look at the world today, there seems to us only one answer," the letter said. "Within the EU, we are stronger."
"Europe is facing a series of grave security challenges, from instability in the Middle East and the rise of Islamic State of Iraq and the Levant, to resurgent Russian nationalism and aggression," it added.
More From This Section
"In a dangerous world, it helps us to safeguard our people, our prosperity and our way of life. We therefore believe strongly that it is in our national interest to remain an EU member."
The Telegraph reported that the letter was in part coordinated by Downing Street.
But his efforts to remain in the EU suffered a blow on Sunday when popular London Mayor Boris Johnson came out in favour of leaving.
A YouGov opinion poll for the Times newspaper today indicated that 38 per cent of voters surveyed wanted to leave the EU while 37 per cent wanted to remain and 25 per cent were undecided.