A trial with 2,876 patients showed there were fewer clots with the wraps.
The Stroke Association said the results were "extremely encouraging" and had the potential to save thousands of lives.
A clot in the leg, a deep vein thrombosis, is normally associated with long flights, but is a problem for hospital patients unable to move.
Around 60,000 people a year in the UK are immobile when admitted to hospital after a stroke.
Doctors at Western General Hospital and the University of Edinburgh said compression socks did not improve survival and clot-busting drugs led to other problems, including bleeding on the brain.
They tested the devices, which fit around the legs and fill with air every minute. They compress the legs and force the blood back to the heart.
They were worn for a month or until the patient recovered and was able to move again.
The study is published in the journal Lancet.