A dozen people were initially listed as missing.
The Morning Bird was hit from behind by another ferry around 9:30 am local time (0330 GMT) during the morning rush hour, when the country's largest river port is packed with vessels.
"We have recovered 32 bodies... We located the ferry more than 50 feet (15 metres) deep in the river," A. Zahidul Islam, a diver in the fire brigade, told AFP.
"I think we have recovered most of the bodies. The rest can only be recovered if the ferry can be salvaged and lifted... it looked like it was stuck in mud at the bottom of the river."
More than 12 hours after the sinking one passenger was found alive.
Rescuers were trying to raise the vessel when they saw the 35-year-old man, Suman Bapary, floating in the river, fire brigade spokesman Kamrul Islam told AFP.
"He was in the sunken ship... all these 13 hours. We don't know how. But it is a miracle," Islam said.
Coastguard spokesman commander Hayet Ibne Siddique said earlier that at least 50 people were believed to have been on board the vessel, which has a capacity of 150 passengers.
The ferry had departed from central Munshiganj district. It sank as it was about to moor at Sadarghat, Dhaka's main river port used by hundreds of boats to travel to the country's south.
Bangladesh Inland Water Transport Authority's chief, Commodore Golam Sadeqk, told AFP the single-deck ship was "not overcrowded" and sank "due to carelessness".
He said the vessel had been cleared to carry passengers until September.
Witnesses told local television stations many passengers appeared to be stuck in the ferry's cabins.
The deceased were put in body bags before they were laid in rows at the harbour front. Another boat would later arrive to lift the damaged vessel from the water, Siddique said.
Trapped
Masud Hossain said he was on board the ferry with two uncles when the accident happened.
"It took no more than five minutes to sink," he told local newspaper The Daily Star, adding that the body of one of his uncles had been found, but another was still missing.
"I thought I was going to die today... I somehow managed to open the window of the cabin (in the ferry) and come out."
Another survivor told reporters that "those who were on the roof of the ferry jumped and survived".
"But those who were inside the deck were trapped and possibly they have all died."
Relatives gathered at Sadarghat to search for their family members, despite coronavirus social distancing concerns.
"I still don't know what happened to them," a man, looking for his cousin and another relative, told reporters.
Boat accidents are common in Bangladesh, which is criss-crossed by more than 230 rivers.
The South Asian nation is heavily reliant on ferries for transport but has had a poor safety record.
Experts blame badly maintained vessels, lax safety standards at shipyards and overcrowding for many of the accidents.
In February 2015 at least 78 people died when an overcrowded ship collided with a cargo boat in a central Bangladesh river.
The number of accidents has dropped sharply in recent years as authorities crack down on unseaworthy vessels.
sa-sam/grk/it