The 23-year-old Afghan national was found guilty by jurors on four counts of attempted murder.
The attacker did not claim any political motivation for his actions.
A couple and their 17-year-old daughter sustained severe injuries in the first attack near Nestroyplatz metro station, surviving thanks only to a quick response from emergency services.
The man then went onto the Praterstern area and stabbed his drug dealer, who he blamed for his "sad life situation", according to prosecutors.
Between attacks, the man was a confronted by a passerby who avoided injury. The suspect was convicted on a further count of coercion for this encounter.
During the trial, the defence sought to portray the events as the result of a "drug-induced psychosis" after the man had consumed three grammes of cocaine and several ecstasy tablets.
A medical expert testified that a small amount of THC, a psychoactive from cannabis consumption, was found in the man's blood.
Psychiatrist Peter Hofmann told the court there was no reason to admit the man for treatment, and that the attacks were "a rampage, as unfortunately occurs more and more often nowadays".
Rage and frustration seemed to have built up in the attacker over a period of years, Hofmann said, adding: "That gnawed at him and much frustration will have been released in this act."
The attacker and his defence team said they planned to appeal the sentence.