Lindsay Sandiford was arrested at Bali’s airport in May last year after 4.8 kg (10.6 lb) of cocaine was found in the lining of her suitcase during a routine customs check.
The woman, whose last UK address was in Gloucestershire, said she was coerced into bringing the drugs to the island.
Her lawyers said they were “surprised” at the verdict and would appeal.
Lindsay Sandiford was held after a flight from Bangkok, Thailand.
Prosecutors had recommended a 15-year sentence of imprisonment.
But the judges said there were no mitigating circumstances and the defendant did not appear to care about the consequences of her actions.
They said Lindsay Sandiford had damaged the image of Bali as a tourism destination and weakened the government’s anti-drugs programme.
Her lawyer said it was very rare that judges delivered a sentence so much harsher than the prosecution had recommended.
The defendant appeared shocked and covered her head with a brown sarong to hide her face from the glare of cameras.
Lindsay Sandiford, originally from Redcar in Teesside, was accused of being at the centre of a ring involving three other Britons.
Last year, Paul Beales was sentenced to four years for possession of drugs and Rachel Dougall was jailed for one year for failing to report a crime.
The drug possession trial of Julian Ponder, from Brighton – who is believed to be Rachel Dougall’s partner – is still taking place. He is alleged to have collected cocaine from Lindsay Sandiford.
Lindsay Sandiford’s case had been taken up by the British human rights charity Reprieve, which said she had been “targeted by drug traffickers who exploited her vulnerability and made threats against her children”.
It says she was held for 10 days without access to a lawyer or translator after her arrest and the Indonesian authorities failed to inform the British embassy during this time.
In response to the sentence, Reprieve’s Harriet McCulloch said: “She is clearly not a drug king pin – she has no money to pay for a lawyer, for the travel costs of defence witnesses or even for essentials like food and water.
“She has cooperated fully with the Indonesian authorities but has been sentenced to death while the gang operating in the UK, Thailand and Indonesia remain free to target other vulnerable people.”
During the trial Lindsay Sandiford’s defence lawyer told Denpasar District Court that a history of mental health problems made her vulnerable.
In a witness statement, Lindsay Sandiford apologized to “the Republic of Indonesia and the Indonesian people” for her involvement.
She added: “I would never have become involved in something like this but the lives of my children were in danger and I felt I had to protect them.”
In another statement read out in court, her son Eliot said he believed his mother was forced into trafficking after a disagreement over rent money she paid on his behalf.
Indonesia has some of the toughest anti-drug laws in the world, but executions rarely take place.
Most of the 40 foreigners currently on death row in Indonesia have been convicted of drug offences, according to Australia’s Lowy Institute for International Policy.
Five foreigners have been executed since 1998, all for drug crimes, but there have been no executions in the country since 2008, said the institute said.
The UK Foreign Office says there are currently 12 British nationals facing the death penalty abroad.
It said: “We are aware that Lindsay Sandiford is facing the death penalty in Indonesia.
“We strongly object to the death penalty and continue to provide consular assistance to Lindsay and her family during this difficult time.”
It said “repeated representations” about the case were made to Indonesia following her arrest and the foreign secretary had raised the case during the Indonesian president’s state visit in November.
The Foreign Office says its policy is to use “all appropriate influence” to prevent the execution of a British national including “high-level political lobbying when necessary”.
Any pressure by the UK government in Lindsay Sandiford’s case was now likely to occur after the judicial appeals process was complete.
Cheltenham MP Martin Horwood said the verdict was unexpected and “very worrying” and he would seek to raise the sentence with Foreign Secretary William Hague.
“I’m appalled by this development,” he said.
“We had been given encouraging signals by the Indonesian ambassador that Indonesia was moving away from the death penalty, that this was something that was associated with the days of the dictatorship, long since past.”
Meanwhile, Sebastian Saville, the former chief executive of the human rights charity Release, said the sentence was “utterly deplorable”.
But he said: “There are many people executed every year in local countries – Thailand, Cambodia – for much smaller amounts of drugs…. So it does not fall out of the remit for someone caught with 5kg of cocaine to be given the death sentence.”
Sebastian Saville added: “If we took a referendum in this country… should people caught with 5kg of cocaine be executed, yes or no… I think you’d be surprised about the number of yeses, as we live in a world which believes in punishment, not in fixing things.”
XciAETQ8oFw tKR5XbO8OT4Image source: Wikimedia Commons President-elect Donald Trump celebrated his election victory at the Ultimate Fighting…
Millions of voters across the US chose to return Donald Trump to the White House…
Donald Trump declares victory in the US election as he addresses jubilant supporters in Florida.…
Stocks around the world are rising as Donald Trump appears to be on the cusp…
Donald Trump has won Pennsylvania, North Carolina and Georgia and taken a lead over Kamala…
Quincy Jones, the celebrated musician and producer who worked with Michael Jackson, Frank Sinatra, Ray…