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,"