Niloy Neel was attacked at his home in the city's Goran area.
He is the fourth secularist blogger to have been killed this year by suspected Islamist militants in Bangladesh.
Imran H Sarkar, head of the Bangladesh Blogger and Activist Network, told the BBC that Mr Neel had been an anti-extremist voice of reason. "He was the voice against fundamentalism and extremism and was even a voice for minority rights - especially women's rights and the rights of indigenous people," he said.
BBC World Service South Asia editor Charles Haviland says that, like previous victims, Mr Neel was not only secular but atheist and, like two of the others, he was from a Hindu, not a Muslim, background.
***
All four men killed were on a list of 84 "atheist bloggers" drawn up by Islamic groups in 2013 and widely circulated. It was originally submitted to the government with the aim of having the bloggers arrested and tried for blasphemy.
***
Bangladesh is officially secular but critics say the government is indifferent to attacks on bloggers by Islamist militants.
Two people have been arrested, but no-one charged, in connection with this year's killings, our correspondent adds."
"If someone needs religion to be good, then that person is not good, it's like a trained dog." - Chagdud Tulku Rinpoche