The decision clears the way for Joe Biden to become the Democratic nominee who faces Donald Trump.
Mr Sanders, 78, told supporters on Wednesday he saw no feasible path to get enough votes to win the nomination.
An early front-runner, the Vermont senator found success with young voters, but slipped behind Mr Biden in recent weeks.
He helped make healthcare and income inequalities key election issues.
Among the most left-leaning candidates during this year's election cycle, the self-described 'Democratic socialist' campaigned on policies including healthcare for all, free public college, raising taxes on the wealthy and increasing minimum wage.
Mr Sanders, an Independent, had sought the Democratic presidential nomination before, losing out in 2016 to Hillary Clinton.
In both elections, he found favour with young voters who embraced his calls for a political 'revolution'.
He won endorsements from a number of celebrities, including Cardi B, Ariana Grande, Miley Cyrus, Mark Ruffalo and Dick Van Dyke.
While Mr Sanders saw support from younger voters, he failed to win key African-American voters across the southern states in the 2020 Democratic primary elections.
In recent weeks, he had been hosting campaign events through online live streams due to health concerns from the Covid-19 outbreak.
Mr Biden, 77, is now expected to be crowned the Democratic presidential nominee at the party's convention in August. He will then face off against President Donald Trump during the November general election.
What did Mr Sanders say?
Mr Sanders told supporters in a live stream that the decision to end his campaign was "very difficult and painful", and acknowledged some of his supporters would have wished him to fight until the last state contest.
"If I believed we had a feasible path to the nomination, I would certainly continue," he said.
Mr Sanders added that the campaign has "transformed American consciousness as to what kind of nation we can become and have taken this country a major step forward in the never-ending struggle for economic justice, social justice, racial justice and environmental justice".
"Please also appreciate that not only are we winning the struggle ideologically, we are also winning it generationally."
Mr Sanders noted that across the country, his campaign received "a significant majority of the votes...from people not only 30 years or younger, but 50 years or younger".
"The future of this country is with our ideas."
Mr Sanders also congratulated Mr Biden, and said that he will work with him to "move our progressive ideas forward".
The senator added that he will still be on ballots in states that have yet to vote in the Democratic primary elections, in order to gather delegates and influence the party's general election platform at the convention.
"Together, standing united, we will go forward to defeat Donald Trump, the most dangerous president in modern American history."
A significant achievement
There will be no repeat of the 2016 campaign for Bernie Sanders. No long fight through all the Democratic primaries, up until the eve of the national convention.
Instead, his second presidential bid ends in early April, with a modest announcement from his home in Vermont, a reflection of a campaign season turned on its head by the coronavirus pandemic. Any hope of a miracle comeback was ended by delayed primaries and the cancellation of all public events.
Sanders came close to winning the prize this time around. After his surprisingly large victory in the Nevada caucuses, he seemed to have the organisation, money and momentum to allow him to break away from the pack. That he didn't will be the subject of what-ifs and second-guessing for years to come.
The Sanders faithful can console themselves with the fact that his two presidential campaigns succeeded in pushing the party to the left on issues like universal healthcare, the environment and free college education.
Although at 78 years old his time as a public figure may be drawing to a close, the movement Sanders created - of progressives unafraid to embrace ambitious government programmes even with a "socialist" label - will carry on.
"Our movement has won the ideological struggle," he said on Wednesday.
It's not the presidency, but it is still a significant achievement.
What's the reaction?
Mr Biden tweeted shortly after Mr Sanders' live stream concluded: "I know Bernie well. He's a good man, a great leader and one of the most powerful voices for change in our country."
The former vice-president added in a statement that he was "grateful" to Mr Sanders for putting America's interest above all else and said he would be reaching out.
"You will be heard by me. As you say: Not me, Us," Mr Biden said.
"To your supporters I make the same commitment: I see you, I hear you, and I understand the urgency of what it is we have to get done in this country. I hope you will join us. You are more than welcome. You're needed."
Massachusetts Senator Elizabeth Warren, a fellow left-leaning Democrat and former presidential hopeful, also thanked Mr Sanders "for fighting so relentlessly for America's working families during this campaign".
In his response, President Donald Trump said Mr Sanders would have won more states if not for Ms Warren's participation in the primary elections, and suggested the Democratic National Committee did not want him to be the nominee.
"The Bernie people should come to the Republican Party, TRADE!" BBC