"Here the message must be sent that Mr Madoff's crimes were extraordinarily evil and that this kind of manipulation of the system is not just a bloodless crime that takes place on paper, but one instead that takes a staggering toll," Judge Chin said.
He said "the breach of trust was massive" and pointed out that no friends, family or other supporters had submitted any letters on Mr Madoff's behalf.
Madoff has 10 days to decide whether to appeal.
His wife Ruth said in a statement released after the hearing that she felt "betrayed and confused".
"The man who committed this horrible fraud is not the man whom I have known for all these years," she said.
'Legacy of shame'
Before the sentencing, Madoff apologised for the "legacy of shame" he had brought on his family and the industry.
"I'm responsible for a great deal of suffering and pain, I understand that," said Madoff, who will spend the rest of his life in prison.
A former investor: ''He is the most despised American today''
He turned directly to those in court who had been affected and said he was sorry.
A number of them had earlier given emotional statements. One had broken down in tears during their testimony.
"Life has been a living hell. It feels like the nightmare we can't wake from," said Carla Hirshhorn.
"May your jail cell be your coffin," Michael Schwartz told Madoff.
The BBC's North America Business Reporter Michelle Fleury said the length of the sentence was unexpected.
Victims would be pleased, she said, but this wasn't the end for them as they are still trying to recover some of their money.
"I think it was certainly a justified sentence," said Judith Welling, who, along with her husband lost $2.5m.
"He's trying to send a message to the world that this sort of behaviour will not be tolerated," she added.
Madoff's sentence dwarfed those handed down to other corporate criminals.
Jeffrey Skilling, 55, Enron's former chief executive, is serving a 24-year sentence while former WorldCom boss Bernard Ebbers, 67, was sentenced to 25 years in prison in 2006.
Bernard Madoff admitted defrauding thousands of investors in a Ponzi scheme which he said had been running since the early 1990s.
Madoff started his financial career aged 22 with $5,000 from money made from summer holiday jobs such as working as a garden sprinkler installer in New York.
He then set up Bernard L Madoff Investment Securities in 1960.
His firm became one of the largest market-makers - matching buyers and sellers of stocks - and Madoff served as chairman of the Nasdaq stock exchange.
Madoff's firm was investigated eight times by the US Securities and Exchange Commission over the past 16 years, because it made exceptional returns.
WHAT IS A PONZI SCHEME?
A fraudulent investment scheme paying investors from money paid in by other investors rather than real profits
Named after Charles Ponzi who notoriously used the technique in the United States in the 1920s
Differs from pyramid selling in that individuals all tend to invest with the same person
But it was the global recession which effectively prompted Madoff's demise as investors, hit by the downturn, tried to withdraw about $7bn from his funds and he could not find the money to cover it.
The list of Madoff's victims includes film director Steven Spielberg's charitable foundation, Wunderkinder.
UK banks were also among the victims with HSBC Holdings saying it had exposure of around $1bn. Other corporate victims were Royal Bank of Scotland and Man Group and Japan's Nomura Holdings.
But it is not just the elite and large firms who were victims of the fraud.
School teachers, farmers, mechanics and many others have also lost money.
This page is best viewed in an up-to-date web browser with style sheets (CSS) enabled. While you will be able to view the content of this page in your current browser, you will not be able to get the full visual experience. Please consider upgrading your browser software or enabling style sheets (CSS) if you are able to do so.