Monsoon rains and rising rivers submerged at least 182 neighborhoods in greater Jakarta and caused landslides in the Bogor and Depok districts on the city's outskirts, which buried a dozen people.
National Disaster Mitigation Agency spokesman Agus Wibowo said the fatalities also included those who had drowned or been electrocuted since rivers broke their banks Wednesday after extreme torrential rains throughout New Year's Eve. Three elderly people died of hypothermia.
It was the worst flooding since 2013, when 57 people were killed after Jakarta was inundated by monsoon rains.
Floodwaters started receded in some parts of the city on Thursday evening, enabling residents to return to their homes.
Wibowo said about 397,000 people sought refuge in shelters across the greater metropolitan area.
Those returning to their homes found streets covered in mud and debris. Cars that had been parked in driveways were swept away, landing upside down in parks or piled up in narrow alleys. Sidewalks were strewn with sandals, pots and pans and old photographs. Authorities took advantage of the receding waters to clear away mud and remove piles of wet garbage from the streets.
Electricity was restored to tens of thousands of residences and businesses.
Jakarta's Halim Perdanakusuma domestic airport reopened Thursday after its runway was submerged. Nearly 20,000 passengers had been affected by the closure.
The flooding has highlighted Indonesia's infrastructure problems.
Jakarta is home to 10 million people, or 30 million including those in its greater metropolitan area. It is prone to earthquakes and flooding and is rapidly sinking due to uncontrolled extraction of ground water. Congestion is also estimated to cost the economy $6.5 billion a year.
President Joko Widodo announced in August that the capital will move to a site in sparsely populated East Kalimantan province on Borneo island, known for rainforests and orangutans.