The victim, Jason Bryden, 38, was repeatedly stabbed during the attack at his home in Kilmarnock on 5 July 2015.
At the High Court in Glasgow, James Clark, 36, was jailed for a least 22 years after being convicted of murder.
His brother John, 38, was jailed for 10 years after being convicted of the lesser charge of culpable homicide.
Jailing both men, judge Bill Dunlop told the brothers that they had carried out "a merciless, relentless and savage attack".
He rejected any suggestion that Mr Bryden had been laying in wait for them armed with a samurai sword.
Judge Dunlop added: "You together planned to gain illegal access with at least one knife and nunchucks.
"Jason Bryden may have been a drug dealer but he was a son, a father and a friend. He was butchered by you."
After both men were jailed, Det Insp David Moran, who led the investigation, said: "The violent and terrible actions of John and James Clark caused the death of Jason Bryden.
"To be taken at the age of 38, in such horrifying circumstances, is a heartbreaking situation that the family has been forced to endure."
The court previously heard the brothers, from Kilmarnock, had decided to rob Mr Bryden of a gold bracelet which they had given to him in exchange for drugs.
The pair, who were high on drink and drugs, went to his home after masking their faces with scarves and arming themselves with a knife and martial arts nunchucks.
The sword used in the killing is believed to have belonged to the dead man.
Neighbours said they could see the Clarks attacking Mr Bryden as he sat on a sofa by the window and could hear him screaming.
Prosecutor Richard Goddard told the trial: "This was a sustained, frenzied attack on this man."
Afterwards, the scene of the killing was described as a "bloodbath".
In addition to the stab wounds, Mr Bryden suffered blunt force trauma during the assault.
He died in Kilmarnock's Crosshouse Hospital three days later.
Both brothers denied the killing.
In evidence, James Clark, who has 38 previous convictions including one for attempted murder, said: "I didn't mean it. It was an accident."
John Clark, who has 23 previous convictions, said he only got involved to help his brother whom he claimed was being attacked by Mr Bryden.
Two brothers have been jailed for killing a man with a samurai sword after a drugs-related robbery in East Ayrshire turned into a "bloodbath".